From f31a0ea7a5d0315f6c23440cccf469714a100f08 Mon Sep 17 00:00:00 2001 From: "Dylan Kiss (dyki)" Date: Thu, 31 Aug 2023 10:51:59 +0200 Subject: [PATCH] [IMP] account: add date options for tax periods Currently the tax report always opens the previous month by default. Since tax periods are not always months, it makes much more sense to open the previous "tax period" (whatever length it has) when opening the tax report. In order to allow that, this commit introduces a "This Tax Period" and "Previous Tax Period" option for reports and sets the default period for the tax report to "Previous Tax Period". The rest of the functionality is done in the related enterprise commit. task-3481913 closes odoo/odoo#133715 Related: odoo/enterprise#46601 Signed-off-by: Olivier Colson (oco) --- addons/account/data/account_reports_data.xml | 2 +- addons/account/models/account_report.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/addons/account/data/account_reports_data.xml b/addons/account/data/account_reports_data.xml index 37305c41600..99973b4b850 100644 --- a/addons/account/data/account_reports_data.xml +++ b/addons/account/data/account_reports_data.xml @@ -7,7 +7,7 @@ Generic Tax report tax_units - last_month + last_tax_period diff --git a/addons/account/models/account_report.py b/addons/account/models/account_report.py index 450e4d1bb15..403201c75ae 100644 --- a/addons/account/models/account_report.py +++ b/addons/account/models/account_report.py @@ -62,6 +62,8 @@ class AccountReport(models.Model): ('last_month', "Last Month"), ('last_quarter', "Last Quarter"), ('last_year', "Last Year"), + ('this_tax_period', "This Tax Period"), + ('last_tax_period', "Last Tax Period"), ], compute=lambda x: x._compute_report_option_filter('default_opening_date_filter', 'last_month'), readonly=False, store=True, depends=['root_report_id', 'section_main_report_ids'],