[FIX] web: call super in AbstractAction willStart

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) <ged@openerp.com>
This commit is contained in:
Mathieu Duckerts-Antoine
2019-03-28 12:47:01 +00:00
parent 85b595e6f0
commit 98e4540fe9
@@ -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