summaryrefslogtreecommitdiff
path: root/addons/pos_discount
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2019-06-27 19:10:09 +0200
committerChristophe Simonis <chs@odoo.com>2019-06-27 19:10:09 +0200
commit6c5783bd5a8b20dce99b26a81e734a50c168bae0 (patch)
tree28f6179342d5799f1cee8bd5da21dc638c70b49a /addons/pos_discount
parentfdcabf19b27cb5427b8f55f922479cb740d590f3 (diff)
parent465909f0fde4d02b101d35c61bab8f0dea20f003 (diff)
[MERGE] forward port branch saas-12.2 up to 465909f0fde
Diffstat (limited to 'addons/pos_discount')
-rw-r--r--addons/pos_discount/static/src/js/discount.js8
1 files changed, 7 insertions, 1 deletions
diff --git a/addons/pos_discount/static/src/js/discount.js b/addons/pos_discount/static/src/js/discount.js
index 87b97f88e16..fc41e55bc05 100644
--- a/addons/pos_discount/static/src/js/discount.js
+++ b/addons/pos_discount/static/src/js/discount.js
@@ -42,10 +42,16 @@ var DiscountButton = screens.ActionButtonWidget.extend({
}
// Add discount
+ // We add the price as manually set to avoid recomputation when changing customer.
var discount = - pc / 100.0 * order.get_total_with_tax();
if( discount < 0 ){
- order.add_product(product, { price: discount });
+ order.add_product(product, {
+ price: discount,
+ extras: {
+ price_manually_set: true,
+ },
+ });
}
},
});