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.
This commit is contained in:
Mihir Kandoi
2026-06-24 20:37:35 +05:30
parent a6ede74b2d
commit cb2679ba2c

View File

@@ -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")