summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre Masereel <pim@odoo.com>2019-09-18 14:17:01 +0000
committerPierre Masereel <pim@odoo.com>2019-09-18 14:17:01 +0000
commitae2c10ec9973adfaf28844138805cbd1722cd1ae (patch)
tree9c43005832a396426c0264ba57e2f42fd7c67fe1
parentebbc9accae34d114550d01c64cfadec746434e65 (diff)
[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.
-rw-r--r--addons/point_of_sale/static/src/js/models.js8
1 files changed, 7 insertions, 1 deletions
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) {