From 98e4540fe9adab8bd0d77fbff7906a5b7fbd01a3 Mon Sep 17 00:00:00 2001 From: Mathieu Duckerts-Antoine Date: Thu, 28 Mar 2019 10:40:44 +0000 Subject: [PATCH] [FIX] web: call super in AbstractAction willStart MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The commit https://github.com/odoo/enterprise/commit/19a144d6af2974e964c6487170e6bca1b14d3898 has modified how libraries are loaded at several places and has introduced a bug in sale_subscription_dashboard where the libraries are no longer loaded at all. We fix that situation by calling super in the willStart method of AbstractAction that inherits from Widget. Abstract actions can now also benefit from the mechanism present in Widget willStart. closes odoo/odoo#32209 Signed-off-by: Géry Debongnie (ged) --- addons/web/static/src/js/chrome/abstract_action.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/addons/web/static/src/js/chrome/abstract_action.js b/addons/web/static/src/js/chrome/abstract_action.js index a5f98434ddb..c40f831e98e 100644 --- a/addons/web/static/src/js/chrome/abstract_action.js +++ b/addons/web/static/src/js/chrome/abstract_action.js @@ -91,20 +91,20 @@ var AbstractAction = Widget.extend(ActionMixin, { */ willStart: function () { var self = this; + var defs = [this._super.apply(this, arguments)]; if (this.hasControlPanel) { var params = this.controlPanelParams; - var def; if (this.loadControlPanel) { - def = this + defs.push(this .loadFieldView(params.modelName, params.context || {}, params.viewId, 'search') .then(function (fieldsView) { params.viewInfo = { arch: fieldsView.arch, fields: fieldsView.fields, }; - }); + })); } - return $.when(def).then(function () { + return $.when.apply(this, defs).then(function () { var controlPanelView = new self.config.ControlPanelView(params); return controlPanelView.getController(self).then(function (controlPanel) { self._controlPanel = controlPanel; @@ -112,7 +112,7 @@ var AbstractAction = Widget.extend(ActionMixin, { }); }); } - return $.when(); + return $.when.apply(this, defs); }, /** * @override