mirror of
https://github.com/frappe/erpnext.git
synced 2026-08-15 15:38:39 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user