diff --git a/addons/account/report/account_invoice_report.py b/addons/account/report/account_invoice_report.py index 7559fe68361..eb2a8633c78 100644 --- a/addons/account/report/account_invoice_report.py +++ b/addons/account/report/account_invoice_report.py @@ -92,7 +92,7 @@ class AccountInvoiceReport(models.Model): move.invoice_date_due, uom_template.id AS product_uom_id, template.categ_id AS product_categ_id, - line.quantity / NULLIF(COALESCE(uom_line.factor, 1) / COALESCE(uom_template.factor, 1), 0.0) + line.quantity / NULLIF(COALESCE(uom_line.factor, 1) / COALESCE(uom_template.factor, 1), 0.0) * (CASE WHEN move.move_type IN ('in_invoice','out_refund','in_receipt') THEN -1 ELSE 1 END) AS quantity, -line.balance AS price_subtotal, -line.balance / NULLIF(COALESCE(uom_line.factor, 1) / COALESCE(uom_template.factor, 1), 0.0) diff --git a/addons/account/tests/test_account_invoice_report.py b/addons/account/tests/test_account_invoice_report.py index fe4327d5b30..92009dd8522 100644 --- a/addons/account/tests/test_account_invoice_report.py +++ b/addons/account/tests/test_account_invoice_report.py @@ -112,7 +112,7 @@ class TestAccountInvoiceReport(AccountTestInvoicingCommon): [1000, 1000, 1], [1000, 1000, 3], [6, 6, 1], - [-20, -20, 1], - [-20, -20, 1], - [-600, -600, 1], + [-20, -20, -1], + [-20, -20, -1], + [-600, -600, -1], ])