From 3f4a056e7c42faa96bbd15de6f13f8dcf03e37b4 Mon Sep 17 00:00:00 2001 From: Vincent Schippefilt Date: Wed, 6 Mar 2019 14:02:30 +0100 Subject: [PATCH] [REF] stock: adapt code after jQuery update Part of task 1896658 Co-authored-by: Aaron Bohy Co-authored-by: Christophe Matthieu Co-authored-by: Mathieu Duckerts-Antoine Co-authored-by: David Monjoie Co-authored-by: Martin Geubelle Co-authored-by: svs-odoo Co-authored-by: Vincent Schippefilt --- .../static/src/js/stock_traceability_report_backend.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/stock/static/src/js/stock_traceability_report_backend.js b/addons/stock/static/src/js/stock_traceability_report_backend.js index aee712a38b3..56673f4e094 100644 --- a/addons/stock/static/src/js/stock_traceability_report_backend.js +++ b/addons/stock/static/src/js/stock_traceability_report_backend.js @@ -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