From 89c2e50933bbcc64219448e1465bb8c79e2c868b Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli Date: Fri, 28 Apr 2017 14:50:52 +0200 Subject: [PATCH] [FIX] account: invoiced amount with down payment - Create a SO of 1000 - Create a down payment of 300, validate - Create the final invoice In the partner view, a total of 1600 is displayed as invoiced. In the case of a down payment, the corresponding invoice line has an amount with a negative sign. Since the report computes the absolute value before multiplying by the sign, this information is lost. The absolute value is not necessary since `price_subtotal_signed` already includes the correct sign. opw-741159 --- addons/account/report/account_invoice_report.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account/report/account_invoice_report.py b/addons/account/report/account_invoice_report.py index e723c984709..09657dbcf75 100644 --- a/addons/account/report/account_invoice_report.py +++ b/addons/account/report/account_invoice_report.py @@ -114,7 +114,7 @@ class AccountInvoiceReport(models.Model): ai.type, ai.state, pt.categ_id, ai.date_due, ai.account_id, ail.account_id AS account_line_id, ai.partner_bank_id, SUM ((invoice_type.sign * ail.quantity) / (u.factor * u2.factor)) AS product_qty, - SUM(invoice_type.sign * ABS(ail.price_subtotal_signed)) AS price_total, + SUM(ail.price_subtotal_signed) AS price_total, SUM(ABS(ail.price_subtotal_signed)) / CASE WHEN SUM(ail.quantity / u.factor * u2.factor) <> 0::numeric THEN SUM(ail.quantity / u.factor * u2.factor)