From 788930d7d233b02409e9e714bf18d80878eb2f1b Mon Sep 17 00:00:00 2001 From: Denis Roussel Date: Thu, 26 Nov 2020 18:00:01 +0000 Subject: [PATCH] [FIX] sale: Wrong argument in untaxed_amount_to_invoice computation closes odoo/odoo#62503 X-original-commit: 0ddad8128d3ea4ab75b98bea8da3c1de676c1b5d Signed-off-by: Nicolas Martinelli (nim) --- addons/sale/models/sale.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/addons/sale/models/sale.py b/addons/sale/models/sale.py index 6fbaa06ea18..398730d6400 100644 --- a/addons/sale/models/sale.py +++ b/addons/sale/models/sale.py @@ -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