From 775bec2a74fa1093580835986d34cf045ebf19cb Mon Sep 17 00:00:00 2001 From: niyasraphy Date: Sat, 15 Jul 2023 08:06:07 +0000 Subject: [PATCH] [FIX] account: traceback on clicking journal in account dashboard before this commit, on clicking the bank journal in ce, is showing traceback. traceback: action['domain'] = (action['domain'] or []) + [('journal_id', '=', self.id)] TypeError: can only concatenate str (not "list") to str after this commit, on clicking no traceback wont be shown and corresponding action will get open closes odoo/odoo#129439 X-original-commit: bbcb925f88cbdc34532894918e50fd11afe7a95d Signed-off-by: John Laterre (jol) --- addons/account/models/account_journal_dashboard.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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):