Browse Source

[FIX] partner_email_unique: allow empty emails

pull/730/head
robin.keunen 6 years ago
parent
commit
e163fb7022
  1. 1
      partner_email_unique/models/res_partner.py
  2. 4
      partner_email_unique/tests/test_res_partner_email.py

1
partner_email_unique/models/res_partner.py

@ -22,6 +22,7 @@ class ResPartner(models.Model):
domain = [
('id', '!=', partner.id),
('email', '=', partner.email),
('email', '!=', False),
]
other_partners = self.search(domain)

4
partner_email_unique/tests/test_res_partner_email.py

@ -33,3 +33,7 @@ class TestResPartnerEmailUnique(common.SavepointCase):
# Test can't create/modify partner with same email
with self.assertRaises(ValidationError):
self.partner2.email = 'same_email@test.com'
# Empty email addresses don't raise
self.partner1.email = False
self.partner2.email = False
Loading…
Cancel
Save