From b6762a0b41f006c9bce1d0c2ffa76dbc7039d1ed Mon Sep 17 00:00:00 2001 From: Goffin Simon Date: Wed, 3 Mar 2021 14:57:38 +0000 Subject: [PATCH] [FIX] sale: Wrong untaxed_amount_to_invoice MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Steps to reproduce the bug: - Let's consider an included tax T (10%) and a product P (11€) with invoicing policy based on delivery - Create a sale order SO with one line L with 2 P and T - Confirm SO and deliver it Bug: The untaxed_amount_to_invoice was 40€ on L instead 20€ opw:2457660 closes odoo/odoo#67188 X-original-commit: 56d92277f20566d5b652ce713551970d0b7784c0 Signed-off-by: Simon Goffin (sig) --- addons/sale/models/sale.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/sale/models/sale.py b/addons/sale/models/sale.py index d7b9f0d09f4..38f262db761 100644 --- a/addons/sale/models/sale.py +++ b/addons/sale/models/sale.py @@ -1571,7 +1571,7 @@ class SaleOrderLine(models.Model): # 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, + line.price_reduce, currency=line.order_id.currency_id, quantity=line.product_uom_qty, product=line.product_id,