From cb2679ba2cb4846d1b10ad0722d5149fd592d3c6 Mon Sep 17 00:00:00 2001 From: Mihir Kandoi Date: Wed, 24 Jun 2026 20:37:35 +0530 Subject: [PATCH] refactor: parse native JSON request args in stock/get_item_details.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/stock/get_item_details.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/erpnext/stock/get_item_details.py b/erpnext/stock/get_item_details.py index b11868347ea..11990db26b8 100644 --- a/erpnext/stock/get_item_details.py +++ b/erpnext/stock/get_item_details.py @@ -90,8 +90,7 @@ def get_item_details( item = frappe.get_cached_doc("Item", ctx.item_code) validate_item_details(ctx, item) - if isinstance(doc, str): - doc = json.loads(doc) + doc = frappe.parse_json(doc) if doc: ctx.transaction_date = doc.get("transaction_date") or doc.get("posting_date")