[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) <jol@odoo.com>
This commit is contained in:
niyasraphy
2023-07-25 17:35:55 +02:00
parent 21392ab236
commit 775bec2a74
@@ -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):