diff options
| author | Julien Castiaux <juc@odoo.com> | 2020-10-07 16:14:40 +0000 |
|---|---|---|
| committer | Julien Castiaux <juc@odoo.com> | 2020-10-07 16:14:40 +0000 |
| commit | 29e844a86508b39031fa8c3f1a2ef3735f71e6f2 (patch) | |
| tree | 9f9dfed838c219ac96074f64df849cb4a3b1704a | |
| parent | e967cd677840029f914c97f549f275a874b15e83 (diff) | |
[FIX] base: fix exception retro-compatibility-aid
Restore the old signature of except_orm.
opw-2354525
opw-2355980
closes odoo/odoo#59443
Signed-off-by: Toufik Benjaa (tbe) <tbe@odoo.com>
| -rw-r--r-- | odoo/exceptions.py | 4 | ||||
| -rw-r--r-- | odoo/osv/osv.py | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/odoo/exceptions.py b/odoo/exceptions.py index af5f17a6e6f..d0587176b65 100644 --- a/odoo/exceptions.py +++ b/odoo/exceptions.py @@ -125,9 +125,9 @@ class ValidationError(UserError): # Warning. class except_orm(UserError): - def __init__(self, *args, **kwargs): + def __init__(self, name, value=None): warnings.warn("except_orm is a deprecated alias to UserError.", DeprecationWarning) - super().__init__(*args, **kwargs) + super().__init__(f"{name}: {value}") class Warning(UserError): def __init__(self, *args, **kwargs): diff --git a/odoo/osv/osv.py b/odoo/osv/osv.py index c0de9c0973e..9d8bada8dae 100644 --- a/odoo/osv/osv.py +++ b/odoo/osv/osv.py @@ -1,11 +1,11 @@ # -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. -from ..exceptions import UserError +from ..exceptions import except_orm from ..models import Model, TransientModel, AbstractModel # Deprecated, kept for backward compatibility. -except_osv = UserError +except_osv = except_orm # Deprecated, kept for backward compatibility. osv = Model |
