summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js
diff options
context:
space:
mode:
authorRémy Baranx (bar) <bar@odoo.com>2020-03-19 12:59:09 +0000
committerYannick Tivisse <yti@odoo.com>2020-03-19 12:59:09 +0000
commitb3d9647695065ea582e4a6b0603f3ebf9fde6976 (patch)
treeff8f1a7700ad8240c4a31d547f3a546c578188f2 /addons/web/static/src/js
parent8e64645b5a0f3864698052d2a2b828c19c5c2b5a (diff)
[IMP] web: use do_action instead of BBQ push_state on RedirectWarning
In the RedirectWarning exception handler, it is better to use 'do_action()' instead of using a BBQ push_state() and then a location.reload(), to preserve the context and avoid losing menus and breadcrumbs for example. As the RedirectWarning receives only the action ID and not the full action, a new parameter has been added to be able to provide a context. This context is added in the 'additional_context' parameter of the do_action() TaskID: 2168071
Diffstat (limited to 'addons/web/static/src/js')
-rw-r--r--addons/web/static/src/js/services/crash_manager.js12
1 files changed, 6 insertions, 6 deletions
diff --git a/addons/web/static/src/js/services/crash_manager.js b/addons/web/static/src/js/services/crash_manager.js
index eee8d1b755d..19db73e1da5 100644
--- a/addons/web/static/src/js/services/crash_manager.js
+++ b/addons/web/static/src/js/services/crash_manager.js
@@ -357,17 +357,17 @@ var RedirectWarningHandler = Widget.extend(ExceptionHandler, {
display: function() {
var self = this;
var error = this.error;
+ var additional_context = _.extend({}, this.context, error.data.arguments[3]);
new WarningDialog(this, {
title: _.str.capitalize(error.type) || _t("Odoo Warning"),
buttons: [
{text: error.data.arguments[2], classes : "btn-primary", click: function() {
- $.bbq.pushState({
- 'action': error.data.arguments[1],
- 'cids': $.bbq.getState().cids,
- }, 2);
- self.destroy();
- location.reload();
+ self.do_action(
+ error.data.arguments[1],
+ {
+ additional_context: additional_context,
+ });
}},
{text: _t("Cancel"), click: function() { self.destroy(); }, close: true}
]