From 1cf5cb242539fc37e1873f35fc42207345302192 Mon Sep 17 00:00:00 2001 From: Mihir Kandoi Date: Wed, 24 Jun 2026 20:37:32 +0530 Subject: [PATCH] refactor: parse native JSON request args in buying/utils.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/buying/utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/erpnext/buying/utils.py b/erpnext/buying/utils.py index f661ecb5d3d..293c084520e 100644 --- a/erpnext/buying/utils.py +++ b/erpnext/buying/utils.py @@ -124,12 +124,12 @@ def check_on_hold_or_closed_status(doctype, docname) -> None: @frappe.whitelist() -def get_linked_material_requests(items: str): +def get_linked_material_requests(items: str | list): """ Retrieve Material Requests linked to a list of items. """ - items = json.loads(items) + items = frappe.parse_json(items) mr_list = [] mr = frappe.qb.DocType("Material Request")