From 348e3ac4ae376738715020bd2ec08b2ab1a06e18 Mon Sep 17 00:00:00 2001 From: Mihir Kandoi Date: Wed, 24 Jun 2026 20:37:31 +0530 Subject: [PATCH] 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. --- .../financial_report_template/financial_report_engine.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/erpnext/accounts/doctype/financial_report_template/financial_report_engine.py b/erpnext/accounts/doctype/financial_report_template/financial_report_engine.py index 6d44796fb1c..d113b3b4d0e 100644 --- a/erpnext/accounts/doctype/financial_report_template/financial_report_engine.py +++ b/erpnext/accounts/doctype/financial_report_template/financial_report_engine.py @@ -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)