refactor: parse native JSON request args in manufacturing/doctype/bom_update_tool/bom_update_tool.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:33 +05:30
parent 5c12bf02d8
commit 5a1abf6138

View File

@@ -32,8 +32,7 @@ class BOMUpdateTool(Document):
def enqueue_replace_bom(boms: dict | str | None = None, args: dict | str | None = None) -> "BOMUpdateLog":
"""Returns a BOM Update Log (that queues a job) for BOM Replacement."""
boms = boms or args
if isinstance(boms, str):
boms = json.loads(boms)
boms = frappe.parse_json(boms)
update_log = create_bom_update_log(boms=boms)
return update_log