summaryrefslogtreecommitdiff
path: root/addons/mail/models/mail_alias.py
diff options
context:
space:
mode:
authorSwapnesh Shah <swapneshshah111@gmail.com>2021-01-27 16:50:15 +0000
committerThibault Delavallée <tde@odoo.com>2021-03-05 11:06:39 +0000
commit5e367616dac74d54942adaa2c07b640c0c0d06da (patch)
treea4b37fc6d438c8f575e7c3d40c21b8764fdf42a5 /addons/mail/models/mail_alias.py
parentda23af62d6a28f194c80f015e96a6973791c48b1 (diff)
[FIX] mail: make alias constraint work in batch
Before this commit there would be `ValueError: Expected singleton:` error on updating `alias_name` on multiple records at same time. Indeed constraint does not allow batch computation. This commits fixes that behavior and now constraint support recordsets with more than one record.. Fixes #65127 closes odoo/odoo#67333 X-original-commit: 16f42ff33f52705253071cf229f4ac575b8ed7e9 Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Diffstat (limited to 'addons/mail/models/mail_alias.py')
-rw-r--r--addons/mail/models/mail_alias.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/mail/models/mail_alias.py b/addons/mail/models/mail_alias.py
index b41b267947f..9ae362d4349 100644
--- a/addons/mail/models/mail_alias.py
+++ b/addons/mail/models/mail_alias.py
@@ -87,7 +87,7 @@ class Alias(models.Model):
local-part. Quoted-string and internationnal characters are
to be rejected. See rfc5322 sections 3.4.1 and 3.2.3
"""
- if self.alias_name and not dot_atom_text.match(self.alias_name):
+ if any(alias.alias_name and not dot_atom_text.match(alias.alias_name) for alias in self):
raise ValidationError(_("You cannot use anything else than unaccented latin characters in the alias address."))
def _compute_alias_domain(self):