mirror of
https://github.com/frappe/erpnext.git
synced 2026-09-17 18:45:20 +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()
|
@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.
|
Retrieve Material Requests linked to a list of items.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
items = json.loads(items)
|
items = frappe.parse_json(items)
|
||||||
mr_list = []
|
mr_list = []
|
||||||
|
|
||||||
mr = frappe.qb.DocType("Material Request")
|
mr = frappe.qb.DocType("Material Request")
|
||||||
|
|||||||
Reference in New Issue
Block a user