summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/chrome
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2018-11-16 19:30:20 +0100
committerChristophe Simonis <chs@odoo.com>2018-11-16 19:30:20 +0100
commit6faad524cf5e4db02855cb213277c40aee14c42a (patch)
tree383c984dc1461a03481baa9fbdce8c156ca97e2e /addons/web/static/src/js/chrome
parent3657dc77c2ddb4275f07d1271b93e7f25e09913a (diff)
parentbc744a1da46efda6f1eb5c341f2fa5df30c9c7ad (diff)
[MERGE] forward port branch 12.0 up to bc744a1da46
Diffstat (limited to 'addons/web/static/src/js/chrome')
-rw-r--r--addons/web/static/src/js/chrome/abstract_action.js7
-rw-r--r--addons/web/static/src/js/chrome/action_manager_act_window.js6
2 files changed, 11 insertions, 2 deletions
diff --git a/addons/web/static/src/js/chrome/abstract_action.js b/addons/web/static/src/js/chrome/abstract_action.js
index 5b0f7e3aeca..c4755338bf0 100644
--- a/addons/web/static/src/js/chrome/abstract_action.js
+++ b/addons/web/static/src/js/chrome/abstract_action.js
@@ -32,6 +32,13 @@ var AbstractAction = Widget.extend({
* Called each time the action is detached from the DOM.
*/
on_detach_callback: function () {},
+ /**
+ * Called by the action manager when action is restored (typically, when the
+ * user clicks on the action in the breadcrumb)
+ *
+ * @returns {Deferred|undefined}
+ */
+ willRestore: function () {},
//--------------------------------------------------------------------------
// Public
diff --git a/addons/web/static/src/js/chrome/action_manager_act_window.js b/addons/web/static/src/js/chrome/action_manager_act_window.js
index 7b87cb45dd3..e66ae801bc1 100644
--- a/addons/web/static/src/js/chrome/action_manager_act_window.js
+++ b/addons/web/static/src/js/chrome/action_manager_act_window.js
@@ -646,8 +646,10 @@ ActionManager.include({
});
} else {
viewOptions = _.extend(viewOptions || {}, action.env);
- return controller.widget.reload(viewOptions).then(function () {
- return controller;
+ return $.when(controller.widget.willRestore()).then(function () {
+ return controller.widget.reload(viewOptions).then(function () {
+ return controller;
+ });
});
}
});