[FIX] sale: pricelist without_discount included taxes

When having a product with included taxes that are changed/removed with
a fiscal position, the price changes depending on if the pricelist's
discount_policy is with_discount or without_discount.

This commit aligns the without_discount behavior to the with_discount
behavior.

Note: the behaviour isn't 100% correct. The applied discount will be
      computed on the list_price, instead of the tax excluded
      list_price. If a price_surcharge is set, it will be wrong.
This commit is contained in:
Denis Vermylen
2017-10-26 16:11:55 +02:00
parent a44954b625
commit 9dee7d1e58
-1
View File
@@ -998,7 +998,6 @@ class SaleOrderLine(models.Model):
price, rule_id = self.order_id.pricelist_id.with_context(pricelist_context).get_product_price_rule(self.product_id, self.product_uom_qty or 1.0, self.order_id.partner_id)
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_company(new_list_price, self.product_id.taxes_id, self.tax_id, self.company_id)
if new_list_price != 0:
if self.order_id.pricelist_id.currency_id.id != currency_id: