From b41baa3c92b2d88649dade308b83ac3ef0c9147b Mon Sep 17 00:00:00 2001 From: len-odoo Date: Wed, 1 Aug 2018 14:53:35 +0200 Subject: [PATCH] [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 --- odoo/exceptions.py | 4 ++++ 1 file changed, 4 insertions(+) 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):