[FIX] pos_restaurant: splitbill would crash on reloaded orders due to not reloading orderline ids

This commit is contained in:
Frédéric van der Essen
2015-01-27 11:46:40 +01:00
parent fcd3f4e9a5
commit 0db25ad1aa
2 changed files with 4 additions and 1 deletions
@@ -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
@@ -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');
}
},
});