From 7cd95c7b3f4db8f305d7c33ae4b4d2bc6270e0b1 Mon Sep 17 00:00:00 2001 From: Jeremy Kersten Date: Mon, 19 Sep 2016 16:59:18 +0200 Subject: [PATCH] [FIX] website_sale: always force the unit price when the pricelist is with_discount When pricelist is updated, with need to recompute the price and force the unit price to the discounted price. --- addons/website_sale/models/sale_order.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/addons/website_sale/models/sale_order.py b/addons/website_sale/models/sale_order.py index 6be5fcd1cf0..c38ad0036a5 100644 --- a/addons/website_sale/models/sale_order.py +++ b/addons/website_sale/models/sale_order.py @@ -144,7 +144,9 @@ class SaleOrder(models.Model): # update line values = self._website_product_id_change(self.id, product_id, qty=quantity) - if not self.env.context.get('fixed_price'): + + + if self.pricelist_id.discount_policy == 'with_discount' and not self.env.context.get('fixed_price'): values['price_unit'] = order_line._get_display_price(order_line.product_id) order_line.write(values)