[FIX] point_of_sale: don't error when splitting an order

4b003afd0a made it so that the constructor
of an orderline calls set_quantity(). The issue is that this function
first asserts that the order is editable. pos_restaurant uses the
clone() of orderline when splitting an order, and this method did not
set order, leading to an error.

This fixes the issue by temporarily cloning the order reference, and
then setting it back to null. It's not the cleanest fix, but seeing as
how the clone() method is only used in one place this will have to do
for now.
This commit is contained in:
Joren Van Onder
2015-12-09 10:33:15 +01:00
parent 12d799623c
commit 6e945de681
+2 -1
View File
@@ -885,10 +885,11 @@ openerp.point_of_sale.load_models = function load_models(instance, module){ //mo
clone: function(){
var orderline = new module.Orderline({},{
pos: this.pos,
order: null,
order: this.order,
product: this.product,
price: this.price,
});
orderline.order = null;
orderline.quantity = this.quantity;
orderline.quantityStr = this.quantityStr;
orderline.discount = this.discount;