19.0 vanilla

This commit is contained in:
Ernad Husremovic 2026-03-09 09:30:53 +01:00
parent dc68f80d3f
commit 7221b9ac46
610 changed files with 135477 additions and 161677 deletions

View file

@ -11,7 +11,7 @@ from .mail_plugin import MailPluginController
class CrmClient(MailPluginController):
@http.route(route='/mail_client_extension/log_single_mail_content',
type="json", auth="outlook", cors="*")
type="jsonrpc", auth="outlook", cors="*")
def log_single_mail_content(self, lead, message, **kw):
"""
deprecated as of saas-14.3, not needed for newer versions of the mail plugin but necessary
@ -20,7 +20,7 @@ class CrmClient(MailPluginController):
crm_lead = request.env['crm.lead'].browse(lead)
crm_lead.message_post(body=message)
@http.route('/mail_client_extension/lead/get_by_partner_id', type="json", auth="outlook", cors="*")
@http.route('/mail_client_extension/lead/get_by_partner_id', type="jsonrpc", auth="outlook", cors="*")
def crm_lead_get_by_partner_id(self, partner, limit=5, offset=0, **kwargs):
"""
deprecated as of saas-14.3, not needed for newer versions of the mail plugin but necessary
@ -37,9 +37,9 @@ class CrmClient(MailPluginController):
"""
server_action = http.request.env.ref("crm_mail_plugin.lead_creation_prefilled_action")
return request.redirect(
'/web#action=%s&model=crm.lead&partner_id=%s' % (server_action.id, int(partner_id)))
'/odoo/action-%s?partner_id=%s' % (server_action.id, int(partner_id)))
@http.route('/mail_plugin/lead/create', type='json', auth='outlook', cors="*")
@http.route('/mail_plugin/lead/create', type='jsonrpc', auth='outlook', cors="*")
def crm_lead_create(self, partner_id, email_body, email_subject):
partner = request.env['res.partner'].browse(partner_id).exists()
if not partner:
@ -60,5 +60,5 @@ class CrmClient(MailPluginController):
for supporting older versions
"""
action = http.request.env.ref("crm.crm_lead_view_form")
url = '/web#id=%s&action=%s&model=crm.lead&edit=1&model=crm.lead' % (lead_id, action.id)
url = '/odoo/action-%s/%s?edit=1' % (action.id, lead_id)
return request.redirect(url)

View file

@ -35,14 +35,14 @@ class MailPluginController(mail_plugin.MailPluginController):
lead_values = {
'lead_id': lead.id,
'name': lead.name,
'expected_revenue': formatLang(request.env, lead.expected_revenue, monetary=True,
'expected_revenue': formatLang(request.env, lead.expected_revenue,
currency_obj=lead.company_currency),
'probability': lead.probability,
}
if recurring_revenues:
lead_values.update({
'recurring_revenue': formatLang(request.env, lead.recurring_revenue, monetary=True,
'recurring_revenue': formatLang(request.env, lead.recurring_revenue,
currency_obj=lead.company_currency),
'recurring_plan': lead.recurring_plan.name,
})
@ -59,7 +59,7 @@ class MailPluginController(mail_plugin.MailPluginController):
"""
contact_values = super(MailPluginController, self)._get_contact_data(partner)
if not request.env['crm.lead'].check_access_rights('create', raise_exception=False):
if not request.env['crm.lead'].has_access('create'):
return contact_values
if not partner:
@ -70,12 +70,12 @@ class MailPluginController(mail_plugin.MailPluginController):
def _mail_content_logging_models_whitelist(self):
models_whitelist = super(MailPluginController, self)._mail_content_logging_models_whitelist()
if not request.env['crm.lead'].check_access_rights('create', raise_exception=False):
if not request.env['crm.lead'].has_access('create'):
return models_whitelist
return models_whitelist + ['crm.lead']
def _translation_modules_whitelist(self):
modules_whitelist = super(MailPluginController, self)._translation_modules_whitelist()
if not request.env['crm.lead'].check_access_rights('create', raise_exception=False):
if not request.env['crm.lead'].has_access('create'):
return modules_whitelist
return modules_whitelist + ['crm_mail_plugin']