Skip to content

Commit dcd7d76

Browse files
committed
[FIX] account_ux: handle list domain in open_invalid_statements_action
The domain returned by super() may already be a Python list instead of a string representation. Calling safe_eval() on a list raises a TypeError. Added an isinstance check to only evaluate the domain if it is a string, keeping the existing behavior for string domains while supporting list domains. closes #969 Signed-off-by: Camila Vives <cav@adhoc.inc>
1 parent 00be8e9 commit dcd7d76

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

account_ux/models/account_journal.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,5 +119,8 @@ def _fill_missing_values(self, vals, protected_codes=False):
119119
def open_invalid_statements_action(self):
120120
self.ensure_one()
121121
res = super().open_invalid_statements_action()
122-
res["domain"] = str(safe_eval(res["domain"]) + [("journal_id", "=", self.id)])
122+
domain = res["domain"]
123+
if isinstance(domain, str):
124+
domain = safe_eval(domain)
125+
res["domain"] = domain + [("journal_id", "=", self.id)]
123126
return res

0 commit comments

Comments
 (0)