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.
This commit is contained in:
Mihir Kandoi
2026-06-24 20:37:32 +05:30
parent c6d34a18a5
commit 1cf5cb2425

View File

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