refactor: parse native JSON request args in stock/doctype/stock_entry/services/manufacturing.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:35 +05:30
parent ddd57ca12e
commit f5bf9392a0

View File

@@ -1040,8 +1040,7 @@ def ceil_qty_if_uom_has_whole_number(qty, stock_uom):
@frappe.whitelist()
def move_sample_to_retention_warehouse(company: str, items: str | list):
if isinstance(items, str):
items = json.loads(items)
items = frappe.parse_json(items)
retention_warehouse = frappe.get_single_value("Stock Settings", "sample_retention_warehouse")
stock_entry = frappe.new_doc("Stock Entry")