From f18f8e401baf4762f1c9ceb4f1a89fee4b1a599b Mon Sep 17 00:00:00 2001 From: Denis Vermylen Date: Wed, 18 Oct 2017 19:00:24 +0200 Subject: [PATCH] [FIX] sale: pricelist price base Fine tuning of 1108c150d9a61bc437a07f03a809c8907714edf4 When setting a pricelist to show the public price discount, it ignored the pricelist item's base field (if not 'Other Pricelist') and set it by default on the lst_price instead. This did not work when you based your discount on the standard_price (= cost price) with public price discount. Now it does. opw:775275 --- addons/sale/models/sale.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/sale/models/sale.py b/addons/sale/models/sale.py index 2c24bee1549..3fef7117eb0 100644 --- a/addons/sale/models/sale.py +++ b/addons/sale/models/sale.py @@ -857,7 +857,8 @@ class SaleOrderLine(models.Model): return price else: from_currency = self.order_id.company_id.currency_id - return from_currency.compute(pricelist_item and product[pricelist_item.base] or product.lst_price, self.order_id.pricelist_id.currency_id) + product_price = product[pricelist_item.base] if (pricelist_item and pricelist_item.base != 'pricelist') else product.lst_price + return from_currency.compute(product_price, self.order_id.pricelist_id.currency_id) @api.multi @api.onchange('product_id')