diff --git a/addons/account/models/account_journal_dashboard.py b/addons/account/models/account_journal_dashboard.py index 4a151b87e4a..bdd7046db4f 100644 --- a/addons/account/models/account_journal_dashboard.py +++ b/addons/account/models/account_journal_dashboard.py @@ -679,15 +679,15 @@ class account_journal(models.Model): # Override the domain only if the action was not explicitly specified in order to keep the # original action domain. + if action.get('domain') and isinstance(action['domain'], str): + action['domain'] = ast.literal_eval(action['domain'] or '[]') if not self._context.get('action_name'): if self.type == 'sale': 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)] + action['domain'] = action['domain'] + [('journal_id', '=', self.id)] return action def open_spend_money(self):