Browse Source

Merge pull request #730 from coopiteasy/9.0-partner-email-no-empty-unique

[FIX] partner_email_unique: allow empty emails
pull/736/head
Ronald Portier 6 years ago
committed by GitHub
parent
commit
a2a843f78e
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  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