From 82a9b77f54152c4b4cf3e51960eaa9b4272dea03 Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli Date: Thu, 30 Jun 2016 10:33:39 +0200 Subject: [FIX] pos_restaurant: order of kitchen ticket When the kitchen ticket is printed, the order lines appear jumbled in comparison to what is displayed on the PoS interface. This is an issue since the kitchen cannot link main and side dishes for a given guest. For example, the following order: - Steak - Fries - Salmon - Pasta - Chicken - Salad On the kitchen ticket, this could appear as: - Salmon - Salad - Chicken - Steak - Fries - Pasta The order actually depends on the product id. The fix is to use the order line id instead of the product id in the resume dictionary. Although a dictionary is an unordered collection, most browsers keep the dictionary ordered. For example: ``` var a = {"18": "18", "1": "1", "21": "21", "14": "14"}; for(var i in a) { console.log(i) }; 1 14 18 21 ``` opw-680796 --- addons/pos_restaurant/static/src/js/multiprint.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'addons/pos_restaurant/static/src/js/multiprint.js') diff --git a/addons/pos_restaurant/static/src/js/multiprint.js b/addons/pos_restaurant/static/src/js/multiprint.js index 19c76a30a4c..6ee225dc0c6 100644 --- a/addons/pos_restaurant/static/src/js/multiprint.js +++ b/addons/pos_restaurant/static/src/js/multiprint.js @@ -133,9 +133,9 @@ models.Orderline = models.Orderline.extend({ }, get_line_diff_hash: function(){ if (this.get_note()) { - return this.get_product().id + '|' + this.get_note(); + return this.id + '|' + this.get_note(); } else { - return '' + this.get_product().id; + return '' + this.id; } }, }); -- cgit v1.2.3