[FIX][12.0][mass_mailing_partner] _check_email_mass_mailing_contacts loop not on self but partner
This commit is contained in:
parent
e6eec5d271
commit
b313196ea2
@ -5,7 +5,7 @@
|
||||
|
||||
{
|
||||
"name": "Link partners with mass-mailing",
|
||||
"version": "12.0.1.0.0",
|
||||
"version": "12.0.1.0.1",
|
||||
"author": "Tecnativa, "
|
||||
"Odoo Community Association (OCA)",
|
||||
"website": "https://github.com/OCA/social",
|
||||
|
@ -32,7 +32,7 @@ class ResPartner(models.Model):
|
||||
@api.constrains('email')
|
||||
def _check_email_mass_mailing_contacts(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(_(
|
||||
"This partner '%s' is linked to one or more mass "
|
||||
"mailing contact. Email must be assigned."
|
||||
|
Loading…
Reference in New Issue
Block a user