mirror of
https://github.com/frappe/erpnext.git
synced 2026-08-11 05:31:48 +00:00
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:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user