mirror of
https://github.com/frappe/erpnext.git
synced 2026-08-14 15:11:52 +00:00
fix: handle native JSON request args in financial report template
Replace json.loads(object_hook=...) with frappe.parse_json and wrap each row in frappe._dict, fixing attribute access when args arrive as native JSON (list of dicts) instead of a JSON string.
This commit is contained in:
@@ -1032,8 +1032,7 @@ class FormulaFieldUpdater:
|
||||
def get_filtered_accounts(company: str, account_rows: str | list):
|
||||
frappe.has_permission("Financial Report Template", ptype="read", throw=True)
|
||||
|
||||
if isinstance(account_rows, str):
|
||||
account_rows = json.loads(account_rows, object_hook=frappe._dict)
|
||||
account_rows = [frappe._dict(row) for row in frappe.parse_json(account_rows)]
|
||||
|
||||
return DataCollector.get_filtered_accounts(company, account_rows)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user