[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
This commit is contained in:
Lucas Perais (lpe)
2017-11-03 14:27:24 +01:00
parent 8360daa057
commit 4b72944bba
+4 -4
View File
@@ -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;