summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlen-odoo <len@odoo.com>2018-08-01 14:53:35 +0200
committerlen-odoo <35492570+len-odoo@users.noreply.github.com>2018-08-13 13:53:12 +0200
commitb41baa3c92b2d88649dade308b83ac3ef0c9147b (patch)
tree03e6e70e9ceabf3cb2d78233ec82df25d9af7100
parentc5e1bffa3db6945834cff460cf35f6b9b37149df (diff)
[FIX] base: handle RedirectWarning exceptions during import
During an import, account_invoice.py's _onchange_partner_id can return a RedirectWarning exception, which wasn't properly handled by the load method. Since it is an Exception, it was expected to have a name field. We add it as a property so that they can be treated uniformly. opw 1866965
-rw-r--r--odoo/exceptions.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/odoo/exceptions.py b/odoo/exceptions.py
index edde12cb3ae..6b4a16102cb 100644
--- a/odoo/exceptions.py
+++ b/odoo/exceptions.py
@@ -46,6 +46,10 @@ class RedirectWarning(Exception):
:param string button_text: text to put on the button that will trigger
the redirection.
"""
+ # using this RedirectWarning won't crash if used as an except_orm
+ @property
+ def name(self):
+ return self.args[0]
class AccessDenied(Exception):