diff options
| author | Victor Feyens <vfe@odoo.com> | 2020-07-14 14:29:10 +0000 |
|---|---|---|
| committer | Victor Feyens <vfe@odoo.com> | 2020-07-23 16:38:17 +0000 |
| commit | 71ab12840bc787ca486202255cd6faa21281b9e1 (patch) | |
| tree | dc8b093e25f9215f2f2c53ff0a084500c88ef560 /addons/website_crm_partner_assign | |
| parent | c69a092b98ad7a7f8e03024d170efa30038c89a0 (diff) | |
[IMP] *: do not specify unwanted defaults in default_get
When default_get is called, the wanted fields are specified through the
fields_list arg. It is useless to fill the values for unwanted fields.
As default_get is called for nearly all records creation, simplifying
the default_get overrides:
* remove potential wrong side-effects of the values
* remove some useless or wrong defaults computations (searches, refs,
...)
Diffstat (limited to 'addons/website_crm_partner_assign')
| -rw-r--r-- | addons/website_crm_partner_assign/wizard/crm_forward_to_partner.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/addons/website_crm_partner_assign/wizard/crm_forward_to_partner.py b/addons/website_crm_partner_assign/wizard/crm_forward_to_partner.py index 9267f6300e3..2bcf16789ba 100644 --- a/addons/website_crm_partner_assign/wizard/crm_forward_to_partner.py +++ b/addons/website_crm_partner_assign/wizard/crm_forward_to_partner.py @@ -32,15 +32,15 @@ class CrmLeadForwardToPartner(models.TransientModel): @api.model def default_get(self, fields): - template = self.env.ref('website_crm_partner_assign.email_template_lead_forward_mail', False) - res = super(CrmLeadForwardToPartner, self).default_get(fields) active_ids = self.env.context.get('active_ids') - default_composition_mode = self.env.context.get('default_composition_mode') - res['assignation_lines'] = [] - if template: - res['body'] = template.body_html + if 'body' in fields: + template = self.env.ref('website_crm_partner_assign.email_template_lead_forward_mail', False) + if template: + res['body'] = template.body_html if active_ids: + default_composition_mode = self.env.context.get('default_composition_mode') + res['assignation_lines'] = [] leads = self.env['crm.lead'].browse(active_ids) if default_composition_mode == 'mass_mail': partner_assigned_dict = leads.search_geo_partner() |
