[REF] stock: adapt code after jQuery update

Part of task 1896658

Co-authored-by: Aaron Bohy <aab@odoo.com>
Co-authored-by: Christophe Matthieu <chm@odoo.com>
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Co-authored-by: David Monjoie <dmo@odoo.com>
Co-authored-by: Martin Geubelle <mge@odoo.com>
Co-authored-by: svs-odoo <svs@odoo.com>
Co-authored-by: Vincent Schippefilt <vsc@odoo.com>
This commit is contained in:
Vincent Schippefilt
2019-03-06 20:07:17 +01:00
committed by Aaron Bohy
co-authored by Aaron Bohy Christophe Matthieu Mathieu Duckerts-Antoine David Monjoie Martin Geubelle svs-odoo
parent de9006f112
commit 3f4a056e7c
@@ -29,11 +29,11 @@ var stock_report_generic = AbstractAction.extend({
this.given_context.lot_name = action.context.lot_name || false;
},
willStart: function() {
return $.when(this._super.apply(this, arguments), this.get_html());
return Promise.all([this._super.apply(this, arguments), this.get_html()]);
},
set_html: function() {
var self = this;
var def = $.when();
var def = Promise.resolve();
if (!this.report_widget) {
this.report_widget = new ReportWidget(this, this.given_context);
def = this.report_widget.appendTo(this.$('.o_content'));
@@ -67,7 +67,7 @@ var stock_report_generic = AbstractAction.extend({
self.html = result.html;
self.renderButtons();
defs.push(self.update_cp());
return $.when.apply($, defs);
return Promise.all(defs);
});
},
// Updates the control panel and render the elements that have yet to be rendered