diff options
| author | Julien Mougenot <jum@odoo.com> | 2020-03-11 09:38:28 +0000 |
|---|---|---|
| committer | Julien Mougenot <jum@odoo.com> | 2020-03-13 14:08:33 +0000 |
| commit | 18e5416636b19b0953b1e6e26bfaeab1ebecce4c (patch) | |
| tree | 5be75af26f1707a5b8b2184545719f3628d2980f /addons/web/static/src/js/chrome/action_manager_act_window.js | |
| parent | fbf347498f1cc7b74ef373179b7bcae201715c24 (diff) | |
[REF] web: Adapt views/actions to new control panel
Some web actions/controllers/viewsl have been adapted to properly instantiate the
newly refactored control panel and update it accordingly. We needed to adapt the
starting mechanism of actions and controllers to ensure that the control panel
instantiation did not delay the loading of any widget.
Part of task 2196029
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Diffstat (limited to 'addons/web/static/src/js/chrome/action_manager_act_window.js')
| -rw-r--r-- | addons/web/static/src/js/chrome/action_manager_act_window.js | 11 |
1 files changed, 6 insertions, 5 deletions
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 ff060153f27..f6c5661eb8e 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 @@ -546,6 +546,7 @@ ActionManager.include({ return Promise.resolve(controller.widget.willRestore()).then(function () { viewOptions = _.extend({}, viewOptions, { breadcrumbs: self._getBreadcrumbs(self.controllerStack.slice(0, index)), + shouldUpdateControlPanel: true, }); return controller.widget.reload(viewOptions).then(function () { return controller; @@ -708,15 +709,15 @@ ActionManager.include({ */ _onSwitchView: function (ev) { ev.stopPropagation(); - var viewType = ev.data.view_type; - var currentController = this.getCurrentController(); + const viewType = ev.data.view_type; + const currentController = this.getCurrentController(); if (currentController.jsID === ev.data.controllerID) { // only switch to the requested view if the controller that // triggered the request is the current controller - var action = this.actions[currentController.actionID]; - var currentControllerState = currentController.widget.exportState(); + const action = this.actions[currentController.actionID]; + const currentControllerState = currentController.widget.exportState(); action.controllerState = _.extend({}, action.controllerState, currentControllerState); - var options = { + const options = { controllerState: action.controllerState, currentId: ev.data.res_id, }; |
