diff options
| author | Christophe Simonis <chs@odoo.com> | 2019-06-18 10:24:25 +0200 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2019-06-18 10:24:25 +0200 |
| commit | 9035fb8a2a4ddfae2951ed1f540060896924bb44 (patch) | |
| tree | 024ce185effd5b1cb59463d2a187a9fa4db35472 /addons/account/report | |
| parent | 0fc33c37c3cea3cadf69c2352f49c88b295bd63f (diff) | |
| parent | 618ea1ab675d6454280deac7d6f853b2556e5be1 (diff) | |
[MERGE] forward port branch saas-12.4 up to 618ea1ab675
Diffstat (limited to 'addons/account/report')
| -rw-r--r-- | addons/account/report/account_invoice_report.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/addons/account/report/account_invoice_report.py b/addons/account/report/account_invoice_report.py index b94bd711c63..2cebf29d6d5 100644 --- a/addons/account/report/account_invoice_report.py +++ b/addons/account/report/account_invoice_report.py @@ -96,7 +96,7 @@ class AccountInvoiceReport(models.Model): sub.payment_term_id, sub.uom_name, sub.currency_id, sub.journal_id, sub.fiscal_position_id, sub.user_id, sub.company_id, sub.nbr, sub.invoice_id, sub.type, sub.state, sub.categ_id, sub.date_due, sub.account_id, sub.account_line_id, sub.partner_bank_id, - sub.product_qty, sub.price_total as price_total, sub.price_average as price_average, sub.amount_total as amount_total, + sub.product_qty, sub.price_total as price_total, sub.price_average as price_average, sub.amount_total / COALESCE(cr.rate, 1) as amount_total, COALESCE(cr.rate, 1) as currency_rate, sub.residual as residual, sub.commercial_partner_id as commercial_partner_id """ return select_str @@ -114,8 +114,7 @@ class AccountInvoiceReport(models.Model): ai.partner_bank_id, SUM ((invoice_type.sign_qty * ail.quantity) / COALESCE(u.factor,1) * COALESCE(u2.factor,1)) AS product_qty, SUM(ail.price_subtotal_signed * invoice_type.sign) AS price_total, - ai.amount_total_signed / (SELECT count(*) FROM account_invoice_line l where invoice_id = ai.id) * - count(*) * invoice_type.sign AS amount_total, + SUM(ail.price_total * invoice_type.sign_qty) AS amount_total, SUM(ABS(ail.price_subtotal_signed)) / CASE WHEN SUM(ail.quantity / COALESCE(u.factor,1) * COALESCE(u2.factor,1)) <> 0::numeric THEN SUM(ail.quantity / COALESCE(u.factor,1) * COALESCE(u2.factor,1)) |
