diff options
| author | Thibault Delavallée <tde@odoo.com> | 2020-10-05 11:34:46 +0000 |
|---|---|---|
| committer | Thibault Delavallée <tde@odoo.com> | 2020-10-05 16:00:51 +0000 |
| commit | 096eac77dbe75946edc81fbeb139e1e20d81722e (patch) | |
| tree | 61d771f96c5caa0c11618bea9c5e58440af1b5dc /addons | |
| parent | 8686a9beb061f51db6fcf0879519d38ffd7d9ea0 (diff) | |
[FIX] crm: fix checking duplicates on dummy emails
Currently when trying to find duplicates of a lead with an email that
cannot be normalized and without partner, a crash appears as there is
no domain part to form a valid domain.
Fix it by returning a void set if no valid email and no valid partner
is set on the lead as we cannot determine any duplicate based on void
information.
closes odoo/odoo#59144
X-original-commit: 291db77cf09c6ee76373fd168f575fda28270467
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Diffstat (limited to 'addons')
| -rw-r--r-- | addons/crm/models/crm_lead.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/crm/models/crm_lead.py b/addons/crm/models/crm_lead.py index ef1eeec18eb..9d4244b58b7 100644 --- a/addons/crm/models/crm_lead.py +++ b/addons/crm/models/crm_lead.py @@ -1125,11 +1125,11 @@ class Lead(models.Model): domain.append(('email_normalized', '=', normalized_email)) if partner: domain.append(('partner_id', '=', partner.id)) - domain = ['|'] * (len(domain) - 1) + domain if not domain: return self.env['crm.lead'] + domain = ['|'] * (len(domain) - 1) + domain if include_lost: domain += ['|', ('type', '=', 'opportunity'), ('active', '=', True)] else: |
