[FIX] base: find_or_create
If two partners have the same email address, the call to `find_or_create` will send a traceback. opw-674681
This commit is contained in:
@@ -636,7 +636,7 @@ class Partner(models.Model, FormatAddress):
|
||||
emails = tools.email_split(email)
|
||||
if emails:
|
||||
email = emails[0]
|
||||
partners = self.search([('email', '=ilike', email)])
|
||||
partners = self.search([('email', '=ilike', email)], limit=1)
|
||||
return partners.id or self.name_create(email)[0]
|
||||
|
||||
def _get_gravatar_image(self, email):
|
||||
|
||||
Reference in New Issue
Block a user