[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:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user