diff options
| author | Adrian Torres <adt@odoo.com> | 2018-12-12 09:46:02 +0000 |
|---|---|---|
| committer | Adrian Torres <adt@odoo.com> | 2019-07-05 09:04:45 +0000 |
| commit | 9e71d57d11faf3fabd00b8a09188e9d4f9808c63 (patch) | |
| tree | 4dfda85fb19bf1f68954cadbd8a39bbb582ef775 /addons/mail/models/mail_alias.py | |
| parent | f5676fabea8a09f5702d00e75f3cf55f01ed5b22 (diff) | |
[REM] *: remove calls to `api.one` and adapt code
Adapt all code that was using `api.one` to recordset-style method and
remove any and all calls to `api.one` in preparation for its removal.
Diffstat (limited to 'addons/mail/models/mail_alias.py')
| -rw-r--r-- | addons/mail/models/mail_alias.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/addons/mail/models/mail_alias.py b/addons/mail/models/mail_alias.py index 8ae39131099..77bdc216728 100644 --- a/addons/mail/models/mail_alias.py +++ b/addons/mail/models/mail_alias.py @@ -79,13 +79,13 @@ class Alias(models.Model): for record in self: record.alias_domain = alias_domain - @api.one @api.constrains('alias_defaults') def _check_alias_defaults(self): - try: - dict(safe_eval(self.alias_defaults)) - except Exception: - raise ValidationError(_('Invalid expression, it must be a literal python dictionary definition e.g. "{\'field\': \'value\'}"')) + for alias in self: + try: + dict(safe_eval(alias.alias_defaults)) + except Exception: + raise ValidationError(_('Invalid expression, it must be a literal python dictionary definition e.g. "{\'field\': \'value\'}"')) @api.model def create(self, vals): |
