[FIX] base: fix crash when using RedirectWarning with an additonnal context

The following commit https://github.com/odoo/odoo/commit/b3d9647695065ea582e4a6b0603f3ebf9fde6976  added the possibility to provide addtionnal context to RedirectWarningHandler.

Unfortunately the RedirectWarning python function does not handle the new argument and crashes.

This commit handle the addtionnal argument.

closes odoo/odoo#55487

Taskid: 2286999
X-original-commit: 60bbf47ad21abb1db7ebd2dc0a9379140007a93d
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
This commit is contained in:
Arnaud Joset
2020-08-05 15:48:22 +00:00
parent 7ec2153ca9
commit f9ddf1b110
+4 -2
View File
@@ -47,9 +47,11 @@ class RedirectWarning(Exception):
:param int action_id: id of the action where to perform the redirection
:param str button_text: text to put on the button that will trigger
the redirection.
:param dict additional_context: parameter passed to action_id.
Can be used to limit a view to active_ids for example.
"""
def __init__(self, message, action, button_text):
super().__init__(message, action, button_text)
def __init__(self, message, action, button_text, additional_context=None):
super().__init__(message, action, button_text, additional_context)
# using this RedirectWarning won't crash if used as an UserError
@property