[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:
@@ -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 = {
|
||||
|
||||
Reference in New Issue
Block a user