diff options
| author | Nicolas Martinelli <nim@odoo.com> | 2019-03-20 15:11:23 +0000 |
|---|---|---|
| committer | Nicolas Martinelli <nim@odoo.com> | 2019-03-20 15:11:23 +0000 |
| commit | 4218f3b5fb8a63983be5a13700f9d36fafc3102d (patch) | |
| tree | d008e1e1074804ceda56c42c0302ff92d58f34d0 /addons/account/report | |
| parent | 3aab70c5a6adc07c4f916c29f7c65fdee81f9e0d (diff) | |
[FIX] account: Invoice Analysis
- Go to Accounting > Reports > Invoices
- Go to the pivot view
- Enable 'Total' and 'Untaxed Total' in the measures
The Total is wrong.
`amount_total` is retrieved on the invoice, unlike the subtotal which is
retreved on the invoice line. We apply the same logic than
`residual_company_signed`.
opw-1950663
closes odoo/odoo#31991
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Diffstat (limited to 'addons/account/report')
| -rw-r--r-- | addons/account/report/account_invoice_report.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/addons/account/report/account_invoice_report.py b/addons/account/report/account_invoice_report.py index aa37b7bec3c..7861644525a 100644 --- a/addons/account/report/account_invoice_report.py +++ b/addons/account/report/account_invoice_report.py @@ -114,7 +114,8 @@ class AccountInvoiceReport(models.Model): ai.partner_bank_id, SUM ((invoice_type.sign_qty * ail.quantity) / u.factor * u2.factor) AS product_qty, SUM(ail.price_subtotal_signed * invoice_type.sign) AS price_total, - SUM(ai.amount_total * invoice_type.sign) AS amount_total, + (ai.amount_total * invoice_type.sign) / (SELECT count(*) FROM account_invoice_line l where invoice_id = ai.id) * + count(*) * invoice_type.sign AS amount_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) |
