[FIX] sale: Wrong argument in untaxed_amount_to_invoice computation

closes odoo/odoo#62503

X-original-commit: 0ddad8128d3ea4ab75b98bea8da3c1de676c1b5d
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
This commit is contained in:
Denis Roussel
2020-11-27 10:31:00 +00:00
committed by Nicolas Martinelli
parent ec04b04b1e
commit 788930d7d2
+6 -1
View File
@@ -1552,7 +1552,12 @@ class SaleOrderLine(models.Model):
# As included taxes are not excluded from the computed subtotal, `compute_all()` method
# has to be called to retrieve the subtotal without them.
# `price_reduce_taxexcl` cannot be used as it is computed from `price_subtotal` field. (see upper Note)
price_subtotal = line.tax_id.compute_all(price_subtotal)['total_excluded']
price_subtotal = line.tax_id.compute_all(
price_subtotal,
currency=line.order_id.currency_id,
quantity=line.product_uom_qty,
product=line.product_id,
partner=line.order_id.partner_shipping_id)['total_excluded']
if any(line.invoice_lines.mapped(lambda l: l.discount != line.discount)):
# In case of re-invoicing with different discount we try to calculate manually the