[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) <gawa@odoo.com>
This commit is contained in:
@@ -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 ""
|
||||
|
||||
|
||||
@@ -354,6 +354,7 @@
|
||||
<filter string="Report Dates" name="date_between" domain="[('date', '>=', context.get('date_from')), ('date', '<=', context.get('date_to'))]" invisible="1"/>
|
||||
<filter string="Report Dates" name="date_before" domain="[('date', '<=', context.get('date_to'))]" invisible="1"/>
|
||||
<separator/>
|
||||
<filter string="Analytic Accounts" name="analytic_accounts" domain="[('analytic_distribution', 'in', context.get('analytic_ids'))]" invisible="1"/>
|
||||
<group expand="0" string="Group By">
|
||||
<filter string="Journal Entry" name="group_by_move" domain="[]" context="{'group_by': 'move_name'}"/>
|
||||
<filter string="Account" name="group_by_account" domain="[]" context="{'group_by': 'account_id'}"/>
|
||||
|
||||
@@ -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
|
||||
]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user