From 3a38080ff5cdcca6318889c1471878593c7e02a0 Mon Sep 17 00:00:00 2001 From: Haresh Shyara Date: Fri, 4 Aug 2017 14:22:00 +0530 Subject: [PATCH] [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 --- addons/account/models/account_invoice.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/addons/account/models/account_invoice.py b/addons/account/models/account_invoice.py index d45fa6fd9c5..1ac52912c81 100644 --- a/addons/account/models/account_invoice.py +++ b/addons/account/models/account_invoice.py @@ -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 = {