[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
This commit is contained in:
len-odoo
2018-08-13 13:53:12 +02:00
committed by len-odoo
parent c5e1bffa3d
commit b41baa3c92
+4
View File
@@ -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):