From d9c116f2b0fe0e1528a401d508cfb5efe886c7b2 Mon Sep 17 00:00:00 2001 From: Jigar Vaghela Date: Wed, 26 Feb 2020 13:23:48 +0000 Subject: [PATCH] [FIX] l10n_in: support 0% tax in report Add zero rated tax report line so we show 0% tax line in report here problem is when 0% tax is created then no tax line is there so this fix is needed. closes odoo/odoo#46408 Opw: 2200619 X-original-commit: a0e2afd5c552a0703da5f94c2ea342907cd83599 Signed-off-by: oco-odoo --- .../data/account_tax_template_data.xml | 75 +++++++++++++++++++ .../l10n_in/report/account_invoice_report.py | 4 +- 2 files changed, 77 insertions(+), 2 deletions(-) diff --git a/addons/l10n_in/data/account_tax_template_data.xml b/addons/l10n_in/data/account_tax_template_data.xml index 1dcd8688047..fd0cbe185b3 100644 --- a/addons/l10n_in/data/account_tax_template_data.xml +++ b/addons/l10n_in/data/account_tax_template_data.xml @@ -65,6 +65,13 @@ 6 + + Zero Rated + Zero Rated + + + 7 + @@ -269,6 +276,40 @@ if tax > result:result=tax + + IGST 0% + IGST 0% + sale + percent + 0 + + + + + + IGST 1% IGST 1% @@ -1172,6 +1213,40 @@ if tax > result:result=tax + + IGST 0% + IGST 0% + purchase + percent + 0 + + + + + + IGST 1% IGST 1% diff --git a/addons/l10n_in/report/account_invoice_report.py b/addons/l10n_in/report/account_invoice_report.py index fc8de7c7cfa..5853d298343 100644 --- a/addons/l10n_in/report/account_invoice_report.py +++ b/addons/l10n_in/report/account_invoice_report.py @@ -246,7 +246,7 @@ class L10nInAccountInvoiceReport(models.Model): JOIN account_move am ON am.id = aml.move_id JOIN account_journal aj ON aj.id = am.journal_id JOIN res_company c ON c.id = aj.company_id - JOIN account_tax at ON at.id = aml.tax_line_id + LEFT JOIN account_tax at ON at.id = aml.tax_line_id JOIN account_account_tag_account_move_line_rel aat_aml_rel ON aat_aml_rel.account_move_line_id = aml.id JOIN account_account_tag aat ON aat.id = aat_aml_rel.account_account_tag_id JOIN account_tax_report_line_tags_rel tag_rep_ln ON aat.id = tag_rep_ln.account_account_tag_id @@ -264,7 +264,7 @@ class L10nInAccountInvoiceReport(models.Model): def _where(self): return """ WHERE am.state = 'posted' - AND tag_rep_ln.account_tax_report_line_id in (SELECT res_id FROM ir_model_data WHERE module='l10n_in' AND name in ('tax_report_line_igst','tax_report_line_cgst','tax_report_line_sgst')) + AND tag_rep_ln.account_tax_report_line_id in (SELECT res_id FROM ir_model_data WHERE module='l10n_in' AND name in ('tax_report_line_igst','tax_report_line_cgst','tax_report_line_sgst','tax_report_line_zero_rated')) """ def _group_by(self):