From a1aec3373642fab38c8bcce0e7407e1d0547e892 Mon Sep 17 00:00:00 2001 From: David Beguin Date: Wed, 5 Dec 2018 08:30:45 +0000 Subject: [PATCH] [IMP] crm, mass_mailing_crm : remove useless override of message_get_default_recipients As CRM inherits directly of blacklist mixin, no need to re-override the message_get_default_recipients in the bridge module. This code was even not in the good place. Anyway, email_normalized can be directly used in the message_get_default_recipients override in crm module itself. Task ID : 1915317 Related Task ID : 1896677 Closes PR #29261 --- addons/crm/models/crm_lead.py | 2 +- addons/mass_mailing_crm/models/__init__.py | 1 - addons/mass_mailing_crm/models/crm_lead.py | 18 ------------------ 3 files changed, 1 insertion(+), 20 deletions(-) delete mode 100644 addons/mass_mailing_crm/models/crm_lead.py diff --git a/addons/crm/models/crm_lead.py b/addons/crm/models/crm_lead.py index a22b07d49a4..a3c20bd00de 100644 --- a/addons/crm/models/crm_lead.py +++ b/addons/crm/models/crm_lead.py @@ -1161,7 +1161,7 @@ class Lead(models.Model): def message_get_default_recipients(self): return { r.id : {'partner_ids': [], - 'email_to': r.email_from, + 'email_to': r.email_normalized, 'email_cc': False} for r in self.sudo() } diff --git a/addons/mass_mailing_crm/models/__init__.py b/addons/mass_mailing_crm/models/__init__.py index 1f42c79380d..972aef5812b 100644 --- a/addons/mass_mailing_crm/models/__init__.py +++ b/addons/mass_mailing_crm/models/__init__.py @@ -2,4 +2,3 @@ # Part of Odoo. See LICENSE file for full copyright and licensing details. from . import mass_mailing -from . import crm_lead diff --git a/addons/mass_mailing_crm/models/crm_lead.py b/addons/mass_mailing_crm/models/crm_lead.py deleted file mode 100644 index ec9553d777c..00000000000 --- a/addons/mass_mailing_crm/models/crm_lead.py +++ /dev/null @@ -1,18 +0,0 @@ -# -*- coding: utf-8 -*- -# Part of Odoo. See LICENSE file for full copyright and licensing details. - -from odoo import api, models - - -class Lead(models.Model): - _name = "crm.lead" - _inherit = ['crm.lead'] - - @api.multi - def message_get_default_recipients(self): - return { - r.id : {'partner_ids': [], - 'email_to': r.email_normalized, - 'email_cc': False} - for r in self.sudo() - }