From 7835cbaa5674d93e34dd4c63359b11113aa4c0c6 Mon Sep 17 00:00:00 2001 From: Mihir Kandoi Date: Wed, 24 Jun 2026 20:37:34 +0530 Subject: [PATCH] refactor: parse native JSON request args in regional/report/irs_1099/irs_1099.py Use frappe.parse_json instead of json.loads so the whitelisted endpoints accept native JSON types (list/dict/bool) in addition to JSON strings. --- erpnext/regional/report/irs_1099/irs_1099.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/erpnext/regional/report/irs_1099/irs_1099.py b/erpnext/regional/report/irs_1099/irs_1099.py index cebc60d1aec..7d9b02ecf54 100644 --- a/erpnext/regional/report/irs_1099/irs_1099.py +++ b/erpnext/regional/report/irs_1099/irs_1099.py @@ -84,7 +84,7 @@ def get_columns(): @frappe.whitelist() -def irs_1099_print(filters: str): +def irs_1099_print(filters: str | dict): if not filters: frappe._dict( { @@ -93,7 +93,7 @@ def irs_1099_print(filters: str): } ) else: - filters = frappe._dict(json.loads(filters)) + filters = frappe._dict(frappe.parse_json(filters)) fiscal_year_doc = get_fiscal_year(fiscal_year=filters.fiscal_year, as_dict=True) fiscal_year = cstr(fiscal_year_doc.year_start_date.year)