From 2cc2fca17ad2cbf686091c4acb3be802bc1691a9 Mon Sep 17 00:00:00 2001 From: Jigar Vaghela Date: Tue, 1 Oct 2019 10:37:53 +0000 Subject: [PATCH] [FIX] l10n_in: Fix report query this is removed in https://github.com/odoo/odoo/commit/3936d655c4bfd845b6ead724cecdc8e7c62816eb#diff-10f4702f062a1eab9a272542d2914710L231 but need to group by parent tax_id if available closes odoo/odoo#38094 X-original-commit: 79ea0b379c87103c6b9167f53722f195b444b0fb Signed-off-by: oco-odoo --- addons/l10n_in/report/account_invoice_report.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/addons/l10n_in/report/account_invoice_report.py b/addons/l10n_in/report/account_invoice_report.py index 60f2f4e1433..65a98083b4b 100644 --- a/addons/l10n_in/report/account_invoice_report.py +++ b/addons/l10n_in/report/account_invoice_report.py @@ -233,8 +233,10 @@ class L10nInAccountInvoiceReport(models.Model): ELSE (CASE WHEN aml.tax_base_amount <> 0 THEN aml.tax_base_amount ELSE NULL END) END AS price_total, (CASE WHEN aj.type = 'sale' AND (am.type IS NULL OR am.type != 'out_refund') THEN -1 ELSE 1 END) AS amount_sign, - at.id AS tax_id, - at.amount AS tax_rate + (CASE WHEN atr.parent_tax IS NOT NULL THEN atr.parent_tax + ELSE at.id END) AS tax_id, + (CASE WHEN atr.parent_tax IS NOT NULL THEN parent_at.amount + ELSE at.amount END) AS tax_rate """ return sub_select_str @@ -254,6 +256,8 @@ class L10nInAccountInvoiceReport(models.Model): LEFT JOIN res_partner p ON p.id = aml.partner_id LEFT JOIN res_country_state ps ON ps.id = p.state_id LEFT JOIN res_partner rp ON rp.id = am.l10n_in_reseller_partner_id + LEFT JOIN account_tax_filiation_rel atr ON atr.child_tax = at.id + LEFT JOIN account_tax parent_at ON parent_at.id = atr.parent_tax """ return from_str