[IMP] account : change unit price according to UoM

It was already the case with the sale order but not on invoices

Task-id: 35387
Closes #18719
This commit is contained in:
Haresh Shyara
2018-02-14 18:49:14 +05:30
committed by Martin Trigaux
parent 102bb626f0
commit 3a38080ff5
+7
View File
@@ -1690,6 +1690,13 @@ class AccountInvoiceLine(models.Model):
result = {}
if not self.uom_id:
self.price_unit = 0.0
else:
if self.invoice_id.type in ('in_invoice', 'in_refund'):
price_unit = self.product_id.standard_price
else:
price_unit = self.product_id.lst_price
self.price_unit = self.product_id.uom_id._compute_price(price_unit, self.uom_id)
if self.product_id and self.uom_id:
if self.product_id.uom_id.category_id.id != self.uom_id.category_id.id:
warning = {