Do not convert invoiced quantity if sale has not unit when computing credit amount

Closes #13715
(grafted from a544d1b5b342dde5f2ace14eab375dd7f0a63b6a)

--HG--
branch : 6.0
This commit is contained in:
Cédric Krier committed 2024-11-29 14:12:01 +01:00
1 parent 37c38d8c19
commit 7ef36ca03a
1 file changed
+7 -3
+7 -3
View File
@@ -40,9 +40,13 @@ class Party(metaclass=PoolMeta):
continue
invoice = invoice_line.invoice
if invoice and invoice.move:
quantity -= Uom.compute_qty(
invoice_line.unit, invoice_line.quantity,
line.unit, round=False)
if line.unit:
quantity -= Uom.compute_qty(
invoice_line.unit or line.unit,
invoice_line.quantity,
line.unit, round=False)
else:
quantity -= invoice_line.quantity
amount += Currency.compute(
sale.currency,
Decimal(str(quantity)) * line.unit_price, currency,