diff --git a/addons/point_of_sale/static/src/js/models.js b/addons/point_of_sale/static/src/js/models.js index 8a95bc8fe8d..7cb613da86e 100644 --- a/addons/point_of_sale/static/src/js/models.js +++ b/addons/point_of_sale/static/src/js/models.js @@ -874,6 +874,8 @@ openerp.point_of_sale.load_models = function load_models(instance, module){ //mo this.price = json.price_unit; this.set_discount(json.discount); this.set_quantity(json.qty); + this.id = json.id; + orderline_id = Math.max(this.id+1,orderline_id) }, clone: function(){ var orderline = new module.Orderline({},{ @@ -997,6 +999,7 @@ openerp.point_of_sale.load_models = function load_models(instance, module){ //mo price_unit: this.get_unit_price(), discount: this.get_discount(), product_id: this.get_product().id, + id: this.id, }; }, //used to create a json of the ticket, to be sent to the printer diff --git a/addons/pos_restaurant/static/src/js/splitbill.js b/addons/pos_restaurant/static/src/js/splitbill.js index 70714418430..cc640599512 100644 --- a/addons/pos_restaurant/static/src/js/splitbill.js +++ b/addons/pos_restaurant/static/src/js/splitbill.js @@ -167,7 +167,7 @@ openerp.pos_restaurant.load_splitbill = function(instance, module){ template: 'SplitbillButton', button_click: function(){ if(this.pos.get_order().get_orderlines().length > 0){ - self.gui.show_screen('splitbill'); + this.gui.show_screen('splitbill'); } }, });