[FIX] sale: Wrong untaxed_amount_to_invoice

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) <sig@openerp.com>
This commit is contained in:
Goffin Simon
2021-03-03 18:30:29 +00:00
parent 03e2bd9638
commit b6762a0b41
+1 -1
View File
@@ -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,