[FIX] sale: 100 % discount

- Set discount policy: Show public price & discount to the customer
- Set a product with 100% discount

When added to a SO, the product discount is 0 %.

opw-727519
This commit is contained in:
Nicolas Martinelli
2017-04-06 08:37:59 +02:00
parent 48aefe61f0
commit d4684ba7cd
+1 -1
View File
@@ -984,7 +984,7 @@ class SaleOrderLine(models.Model):
new_list_price, currency_id = self.with_context(context_partner)._get_real_price_currency(self.product_id, rule_id, self.product_uom_qty, self.product_uom, self.order_id.pricelist_id.id)
new_list_price = self.env['account.tax']._fix_tax_included_price(new_list_price, self.product_id.taxes_id, self.tax_id)
if price != 0 and new_list_price != 0:
if new_list_price != 0:
if self.product_id.company_id and self.order_id.pricelist_id.currency_id != self.product_id.company_id.currency_id:
# new_list_price is in company's currency while price in pricelist currency
new_list_price = self.env['res.currency'].browse(currency_id).with_context(context_partner).compute(new_list_price, self.order_id.pricelist_id.currency_id)