[FIX] website_quote: negative discounts are always included in the display price

Before this commit, negative discounts (surcharges) were shown in the
sales order when the price list have the option : "Show public price &
discount to the customer".

Now,  the negative discounts are included in the display price. This
issue was already been addressed in the sales module (see https://github.com/odoo/odoo/blob/ac170e8a8238a9b0aa468f83b11aabc4cd9493de/addons/sale/models/sale.py#L1046)

Fine-tunning of : cae506f0ed

opw-2039071

closes odoo/odoo#35065

Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
This commit is contained in:
Jorge Pinna Puissant
2019-07-22 12:31:53 +00:00
parent ac170e8a82
commit fb9caab7c1
+5 -1
View File
@@ -122,7 +122,11 @@ class SaleOrder(models.Model):
price = self.pricelist_id.with_context(uom=line.product_uom_id.id).get_product_price(line.product_id, line.product_uom_qty, False)
if self.pricelist_id.discount_policy == 'without_discount' and line.price_unit:
discount = (line.price_unit - price) / line.price_unit * 100
price = line.price_unit
# negative discounts (= surcharge) are included in the display price
if discount < 0:
discount = 0
else:
price = line.price_unit
else:
price = line.price_unit