From 4b72944bbaf81f224d8b50b01237faa6d80d911a Mon Sep 17 00:00:00 2001 From: "Lucas Perais (lpe)" Date: Mon, 30 Oct 2017 11:18:06 +0100 Subject: [PATCH] [FIX] point_of_sale: fix invoice download and receipt printing When opening the POS in this specific case: - Under Mozilla Firefox - auto printing the receipt is True - invoicing is True Before this commit, when issuing an invoice for a customer, a Traceback was thrown to the user and the invoice was not downloaded. This was because the invoiced parameter resolved before the printing action was. After this commit, we constain the invoiced parameter to be resolved when the action returns. There is no traceback, and the invoice is downloaded OPW 777647 closes #20570 --- addons/point_of_sale/static/src/js/models.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/addons/point_of_sale/static/src/js/models.js b/addons/point_of_sale/static/src/js/models.js index 2beafcd30ae..d6f3f39b173 100644 --- a/addons/point_of_sale/static/src/js/models.js +++ b/addons/point_of_sale/static/src/js/models.js @@ -725,10 +725,10 @@ exports.PosModel = Backbone.Model.extend({ // generate the pdf and download it self.chrome.do_action('point_of_sale.pos_invoice_report',{additional_context:{ active_ids:order_server_id, - }}); - - invoiced.resolve(); - done.resolve(); + }}).done(function () { + invoiced.resolve(); + done.resolve(); + }); }); return done;