diff --git a/addons/crm_mail_plugin/controllers/crm_client.py b/addons/crm_mail_plugin/controllers/crm_client.py index fccee1dee7d..72c5bc1dc36 100644 --- a/addons/crm_mail_plugin/controllers/crm_client.py +++ b/addons/crm_mail_plugin/controllers/crm_client.py @@ -45,9 +45,6 @@ class CrmClient(http.Controller): if not partner: return {'error': 'partner_not_found'} - # In a multi-company environment, we will not be able to create a lead if the user is connected to a different - # company then the one linked to the contact, this is not supported, and users are encouraged to check if they - # are connected to the right company before performing such operation. record = request.env['crm.lead'].create({ 'name': html2plaintext(email_subject), 'partner_id': partner_id, diff --git a/addons/mail_plugin/controllers/mail_plugin.py b/addons/mail_plugin/controllers/mail_plugin.py index 40f751eab46..0450755179d 100644 --- a/addons/mail_plugin/controllers/mail_plugin.py +++ b/addons/mail_plugin/controllers/mail_plugin.py @@ -111,11 +111,6 @@ class MailPluginController(http.Controller): The method returns an array containing the dicts of the matched contacts. """ - #In a multi-company environment, the method may return contacts not belonging to the company that the user - #is connected to, this may result in the user not being able to view the contact in Odoo, while this may happen - #it is not supported for now and users are encouraged to check if they are connected to the correct company before - # clicking on a contact. - normalized_email = tools.email_normalize(search_term) if normalized_email: @@ -313,7 +308,10 @@ class MailPluginController(http.Controller): else: # no partner found partner_response = {} - return {'partner': partner_response} + return { + 'partner': partner_response, + 'user_companies': request.env['res.users'].browse(request.uid).company_ids.ids + } def _mail_content_logging_models_whitelist(self): """