[FIX][12.0][mass_mailing_partner] _check_email_mass_mailing_contacts loop not on self but partner

This commit is contained in:
Tonow-c2c 2019-11-13 09:32:28 +01:00 committed by emagdalenaC2i
parent e6eec5d271
commit b313196ea2
2 changed files with 2 additions and 2 deletions

View File

@ -5,7 +5,7 @@
{ {
"name": "Link partners with mass-mailing", "name": "Link partners with mass-mailing",
"version": "12.0.1.0.0", "version": "12.0.1.0.1",
"author": "Tecnativa, " "author": "Tecnativa, "
"Odoo Community Association (OCA)", "Odoo Community Association (OCA)",
"website": "https://github.com/OCA/social", "website": "https://github.com/OCA/social",

View File

@ -32,7 +32,7 @@ class ResPartner(models.Model):
@api.constrains('email') @api.constrains('email')
def _check_email_mass_mailing_contacts(self): def _check_email_mass_mailing_contacts(self):
for partner in self: for partner in self:
if not partner.email and self.sudo().mass_mailing_contact_ids: if not partner.email and partner.sudo().mass_mailing_contact_ids:
raise ValidationError(_( raise ValidationError(_(
"This partner '%s' is linked to one or more mass " "This partner '%s' is linked to one or more mass "
"mailing contact. Email must be assigned." "mailing contact. Email must be assigned."