From cc72b0c2fada765746ac5347b779c8e5d63f530c Mon Sep 17 00:00:00 2001 From: "Lucas Perais (lpe)" Date: Mon, 20 Aug 2018 16:59:39 +0200 Subject: [PATCH] [FIX] crm: fix API Because of 2917b38f28d5c2d6c53c706e613da7b8e2ad7b52 which appeared in v9.0 but has not been adapted to the new API afterwards, the early return was out of sync with what a search returns in new API in v9.0: search returns a list, so must our early return in v10.0: search returns a recordset, hence the fix OPW 1878192 closes #26474 --- addons/crm/models/crm_lead.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/crm/models/crm_lead.py b/addons/crm/models/crm_lead.py index ae094b4469c..3cec41d721e 100644 --- a/addons/crm/models/crm_lead.py +++ b/addons/crm/models/crm_lead.py @@ -659,7 +659,7 @@ class Lead(FormatAddress, models.Model): def _get_duplicated_leads_by_emails(self, partner_id, email, include_lost=False): """ Search for opportunities that have the same partner and that arent done or cancelled """ if not email: - return [] + return self.env['crm.lead'] partner_match_domain = [] for email in set(email_split(email) + [email]): partner_match_domain.append(('email_from', '=ilike', email))