[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.
This commit is contained in:
Jeremy Kersten
2016-09-21 21:29:18 +02:00
parent 690d01b166
commit 7cd95c7b3f
+3 -1
View File
@@ -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)