summaryrefslogtreecommitdiff
path: root/addons/pos_restaurant/static
diff options
context:
space:
mode:
authorAntoine Prieels <anp@odoo.com>2020-01-24 08:17:53 +0000
committerAntoine Prieels <anp@odoo.com>2020-01-24 10:51:36 +0000
commitabbbeb571487195c4b4918d4c640c75d9adf0fff (patch)
tree4c4f6a46668989ab5aac184d010b5b8bdf6afffb /addons/pos_restaurant/static
parentec3a947f3bfdafbb211f3aae58aa7d5bc7e8e7a8 (diff)
[FIX] point_of_sale,pos_restaurant: Multiprint
Printed receipts are transformed into images by placing them into an hidden `div`. When trying to print multiple orders, we did not wait correctly between rendering the different receipts. Receipts were then overriding one another while they were being rendered, resulting in errors and missing receipts. closes odoo/odoo#43907 X-original-commit: 00ba908d7b3d8b1145e4161ea8d9011ff6eea33d Signed-off-by: Antoine Prieƫls <aprieels@users.noreply.github.com>
Diffstat (limited to 'addons/pos_restaurant/static')
-rw-r--r--addons/pos_restaurant/static/src/js/multiprint.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/addons/pos_restaurant/static/src/js/multiprint.js b/addons/pos_restaurant/static/src/js/multiprint.js
index cfc59661a71..d284917b940 100644
--- a/addons/pos_restaurant/static/src/js/multiprint.js
+++ b/addons/pos_restaurant/static/src/js/multiprint.js
@@ -297,13 +297,13 @@ models.Order = models.Order.extend({
};
},
- printChanges: function(){
+ printChanges: async function(){
var printers = this.pos.printers;
for(var i = 0; i < printers.length; i++){
var changes = this.computeChanges(printers[i].config.product_categories_ids);
if ( changes['new'].length > 0 || changes['cancelled'].length > 0){
var receipt = QWeb.render('OrderChangeReceipt',{changes:changes, widget:this});
- printers[i].print_receipt(receipt);
+ await printers[i].print_receipt(receipt);
}
}
},
@@ -339,10 +339,10 @@ models.Order = models.Order.extend({
var SubmitOrderButton = screens.ActionButtonWidget.extend({
'template': 'SubmitOrderButton',
- button_click: function(){
+ button_click: async function(){
var order = this.pos.get_order();
if(order.hasChangesToPrint()){
- order.printChanges();
+ await order.printChanges();
order.saveChanges();
}
},