From ae2c10ec9973adfaf28844138805cbd1722cd1ae Mon Sep 17 00:00:00 2001 From: Pierre Masereel Date: Wed, 18 Sep 2019 14:17:01 +0000 Subject: [PATCH] [FIX] point_of_sale: avoid tip price modification When a tip is added, the price of the product is changed, and so we don't want to recompute the unit price if quantity is changed. --- addons/point_of_sale/static/src/js/models.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/addons/point_of_sale/static/src/js/models.js b/addons/point_of_sale/static/src/js/models.js index 009ad0e992b..29d882f5878 100644 --- a/addons/point_of_sale/static/src/js/models.js +++ b/addons/point_of_sale/static/src/js/models.js @@ -2560,10 +2560,16 @@ exports.Order = Backbone.Model.extend({ if (lines[i].get_product() === tip_product) { lines[i].set_unit_price(tip); lines[i].set_lst_price(tip); + lines[i].price_manually_set = true; return; } } - this.add_product(tip_product, {quantity: 1, price: tip, lst_price: tip }); + this.add_product(tip_product, { + quantity: 1, + price: tip, + lst_price: tip, + extras: {price_manually_set: true}, + }); } }, set_pricelist: function (pricelist) {