diff options
| author | Arnaud Joset <arj@odoo.com> | 2020-06-29 12:41:03 +0000 |
|---|---|---|
| committer | Arnaud Joset <arj@odoo.com> | 2020-08-05 15:48:22 +0000 |
| commit | f9ddf1b110531cc443cc9d4aaffdf832c7a7189a (patch) | |
| tree | 4aff1dea538f1f80ec0457a5fb1a1174486fab63 /odoo/exceptions.py | |
| parent | 7ec2153ca978beba70598437ed3ede7cab15f5a7 (diff) | |
[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>
Diffstat (limited to 'odoo/exceptions.py')
| -rw-r--r-- | odoo/exceptions.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/odoo/exceptions.py b/odoo/exceptions.py index 43281b8bca9..af5f17a6e6f 100644 --- a/odoo/exceptions.py +++ b/odoo/exceptions.py @@ -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 |
