From 45b95c12db8837addba0c16bcd522c7bb8e971be Mon Sep 17 00:00:00 2001 From: hupo-odoo Date: Tue, 5 Sep 2023 16:40:50 +0200 Subject: [PATCH] [IMP] account_report: new option for favorite filters Adds a new boolean field on accounting report to enable the user to select user-defined filter on accounting reports. If activated, the user can visualize its own favorite filter (defined on journal items list view) on a new option selector on top of accounting reports (see enterprise commit). When selected, the domain of the user-defined filter is added to other selected options' domain. task-3444246 closes odoo/odoo#134966 Related: odoo/enterprise#47200 Signed-off-by: Olivier Colson (oco) --- addons/account/models/account_report.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/addons/account/models/account_report.py b/addons/account/models/account_report.py index 7a5125614cb..74987a0b98e 100644 --- a/addons/account/models/account_report.py +++ b/addons/account/models/account_report.py @@ -127,6 +127,10 @@ class AccountReport(models.Model): string="Filter Multivat", compute=lambda x: x._compute_report_option_filter('filter_fiscal_position'), readonly=False, store=True, depends=['root_report_id', 'section_main_report_ids'], ) + filter_aml_ir_filters = fields.Boolean( + string="Favorite Filters", help="If activated, user-defined filters on journal items can be selected on this report", + compute=lambda x: x._compute_report_option_filter('filter_aml_ir_filters'), readonly=False, store=True, depends=['root_report_id', 'section_main_report_ids'], + ) def _compute_report_option_filter(self, field_name, default_value=False): # We don't depend on the different filter fields on the root report, as we don't want a manual change on it to be reflected on all the reports