[FIX] pos_restaurant: splitbill would crash on reloaded orders due to not reloading orderline ids
This commit is contained in:
@@ -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');
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user