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