summaryrefslogtreecommitdiff
path: root/odoo/exceptions.py
diff options
context:
space:
mode:
authorJulien Castiaux <juc@odoo.com>2020-04-15 14:52:08 +0000
committerJulien Castiaux <juc@odoo.com>2020-05-14 14:00:41 +0000
commitb6537c4335356ed660d2acbd914783d4ceea2521 (patch)
tree6baa8e51fe964efea680676facfc56434635a761 /odoo/exceptions.py
parent55cb0de1dbbce55297d167335b76f0654124efb8 (diff)
[REV] base: restore removed deprecated osv and exceptions
To ensure backward compatibility, stuff removed by ab4000fb3 have been restored. closes odoo/odoo#49603 Task: 2234749 Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
Diffstat (limited to 'odoo/exceptions.py')
-rw-r--r--odoo/exceptions.py30
1 files changed, 20 insertions, 10 deletions
diff --git a/odoo/exceptions.py b/odoo/exceptions.py
index 8400194e75a..43281b8bca9 100644
--- a/odoo/exceptions.py
+++ b/odoo/exceptions.py
@@ -39,16 +39,6 @@ class UserError(Exception):
return self.args[0]
-# deprecated due to collision with builtins, kept for compatibility
-class Warning(UserError):
- def __init__(self, *args, **kwargs):
- warnings.warn(
- "Warning is a deprecated alias to UserError and is going to be "
- "removed in a future version.",
- DeprecationWarning)
- super().__init__(*args, **kwargs)
-
-
class RedirectWarning(Exception):
""" Warning with a possibility to redirect the user instead of simply
displaying the warning message.
@@ -126,3 +116,23 @@ class ValidationError(UserError):
When you try to create a new user with a login which already exist in the db.
"""
+
+
+# Deprecated exceptions, only kept for backward compatibility, may be
+# removed in the future *without* any futher notice than the Deprecation
+# Warning.
+
+class except_orm(UserError):
+ def __init__(self, *args, **kwargs):
+ warnings.warn("except_orm is a deprecated alias to UserError.", DeprecationWarning)
+ super().__init__(*args, **kwargs)
+
+class Warning(UserError):
+ def __init__(self, *args, **kwargs):
+ warnings.warn("Warning is a deprecated alias to UserError.", DeprecationWarning)
+ super().__init__(*args, **kwargs)
+
+class QWebException(Exception):
+ def __init__(self, *args, **kwargs):
+ warnings.warn("qweb.QWebException is the exception you are looking for.", DeprecationWarning)
+ super().__init__(*args, **kwargs)