[FIX] base: default partner email

In a lead:
- Fill in contact information (phone, address, email...)
- Create a new contact

All information is copied to the new contact, except the email.

opw-706711
This commit is contained in:
Nicolas Martinelli
2017-02-21 11:04:54 +01:00
parent 79d88494d6
commit 05810dc7de
+1 -1
View File
@@ -618,7 +618,7 @@ class Partner(models.Model, FormatAddress):
raise UserError(_("Couldn't create contact without email address!"))
if not name and email:
name = email
partner = self.create({self._rec_name: name or email, 'email': email or False})
partner = self.create({self._rec_name: name or email, 'email': email or self.env.context.get('default_email', False)})
return partner.name_get()[0]
@api.model