mirror of
https://github.com/frappe/erpnext.git
synced 2026-08-11 05:31:48 +00:00
refactor: parse native JSON request args in manufacturing/doctype/production_plan/services/planning_queries.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:
@@ -24,8 +24,7 @@ def get_bin_details(
|
||||
):
|
||||
frappe.has_permission("Production Plan", "read", throw=True)
|
||||
|
||||
if isinstance(row, str):
|
||||
row = frappe._dict(json.loads(row))
|
||||
row = frappe._dict(frappe.parse_json(row))
|
||||
|
||||
bin = frappe.qb.DocType("Bin")
|
||||
subquery = _bin_warehouse_subquery(bin, company, row, for_warehouse, all_warehouse)
|
||||
@@ -65,8 +64,7 @@ def _bin_qty_columns(bin):
|
||||
def get_warehouse_list(warehouses):
|
||||
warehouse_list = []
|
||||
|
||||
if isinstance(warehouses, str):
|
||||
warehouses = json.loads(warehouses)
|
||||
warehouses = frappe.parse_json(warehouses)
|
||||
|
||||
for row in warehouses:
|
||||
child_warehouses = frappe.db.get_descendants("Warehouse", row.get("warehouse"))
|
||||
|
||||
Reference in New Issue
Block a user