From f9e09bc7a31d5ca3f1e9ab50e8864b1003d55ee5 Mon Sep 17 00:00:00 2001 From: "Andrea Grazioso (agr-odoo)" Date: Thu, 15 Jun 2023 16:24:51 +0000 Subject: [PATCH] [FIX] account: dashboard actions search filter Create a Bill Register payment Create the bank statement Match with the payment Go to accounting dashboard, hit "Vendor Bill" (open bill list view) Clear filters Add filter: Unpaid Issue: Users should not be able to clear the journal filter when opening the bill view This commit align the behavior of the dashboard to the menu entries by adding a default search domain to the actions instead of the default search filter opw-3228450 closes odoo/odoo#128203 X-original-commit: 4e612d5434d8254c3ba44b8a00d7d71bc0ab4084 Signed-off-by: Olivier Colson (oco) Signed-off-by: Andrea Grazioso (agr) --- addons/account/models/account_journal_dashboard.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/addons/account/models/account_journal_dashboard.py b/addons/account/models/account_journal_dashboard.py index cf118e2c9b8..9f491afe40a 100644 --- a/addons/account/models/account_journal_dashboard.py +++ b/addons/account/models/account_journal_dashboard.py @@ -664,9 +664,7 @@ class account_journal(models.Model): action['context'] = context action['context'].update({ 'default_journal_id': self.id, - 'search_default_journal_id': self.id, }) - domain_type_field = action['res_model'] == 'account.move.line' and 'move_id.move_type' or 'move_type' # The model can be either account.move or account.move.line # Override the domain only if the action was not explicitly specified in order to keep the @@ -676,7 +674,10 @@ class account_journal(models.Model): action['domain'] = [(domain_type_field, 'in', ('out_invoice', 'out_refund', 'out_receipt'))] elif self.type == 'purchase': action['domain'] = [(domain_type_field, 'in', ('in_invoice', 'in_refund', 'in_receipt', 'entry'))] + elif action['domain']: + action['domain'] = ast.literal_eval(action['domain']) + action['domain'] = (action['domain'] or []) + [('journal_id', '=', self.id)] return action def open_spend_money(self):