[FIX] crm: fix API

Because of 2917b38f28 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
This commit is contained in:
Lucas Perais (lpe)
2018-08-21 09:37:54 +02:00
parent 07b5f205ab
commit cc72b0c2fa
+1 -1
View File
@@ -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))