From d6bdb05771fd29a79f2e8087b92a438fec28afaa Mon Sep 17 00:00:00 2001 From: "Dylan Kiss (dyki)" Date: Tue, 6 Feb 2024 15:57:01 +0100 Subject: [PATCH] [FIX] account,analytic: keep analytic filter on auditing Currently when we have an Analytic Filter applied on an accounting report, we lose that filter when we click on any amount to audit the journal items. This fix makes sure that when auditing, we only view the journal items filtered by the Analytic Filter. In order to do that, we extend the search function in the analytic mixin to allow searching on analytic account ids. task-3718751 closes odoo/odoo#161873 X-original-commit: 2e3be9726514f74ea8c0c2314c9cdfeb6ed57915 Related: odoo/enterprise#60742 Signed-off-by: Wala Gauthier (gawa) --- addons/account/i18n/account.pot | 1 + addons/account/views/account_move_views.xml | 1 + addons/analytic/models/analytic_mixin.py | 4 +++- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/addons/account/i18n/account.pot b/addons/account/i18n/account.pot index 0248ceac264..c5a1ceedb0c 100644 --- a/addons/account/i18n/account.pot +++ b/addons/account/i18n/account.pot @@ -2449,6 +2449,7 @@ msgstr "" #. module: account #: model:ir.ui.menu,name:account.account_analytic_def_account +#: model_terms:ir.ui.view,arch_db:account.view_account_move_line_filter msgid "Analytic Accounts" msgstr "" diff --git a/addons/account/views/account_move_views.xml b/addons/account/views/account_move_views.xml index 5597ae0b16a..d542cbca6fd 100644 --- a/addons/account/views/account_move_views.xml +++ b/addons/account/views/account_move_views.xml @@ -354,6 +354,7 @@ + diff --git a/addons/analytic/models/analytic_mixin.py b/addons/analytic/models/analytic_mixin.py index 939c6cd9ede..d8ec1b0f283 100644 --- a/addons/analytic/models/analytic_mixin.py +++ b/addons/analytic/models/analytic_mixin.py @@ -125,7 +125,9 @@ class AnalyticMixin(models.AbstractModel): def _apply_analytic_distribution_domain(self, domain): return [ - ('analytic_distribution_search', leaf[1], leaf[2]) if len(leaf) == 3 and leaf[0] == 'analytic_distribution' and isinstance(leaf[2], (str, tuple, list)) else leaf + ('analytic_distribution_search', leaf[1], leaf[2]) + if len(leaf) == 3 and leaf[0] == 'analytic_distribution' and isinstance(leaf[2], (str, tuple, list)) + else leaf for leaf in domain ]