[FIX] sale: pricelist price base

Fine tuning of 1108c150d9

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
This commit is contained in:
Denis Vermylen
2017-10-19 10:56:25 +02:00
parent 4f921d668a
commit f18f8e401b
+2 -1
View File
@@ -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')