refactor: parse native JSON request args in stock/report/stock_qty_vs_batch_qty/stock_qty_vs_batch_qty.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 cb2679ba2c
commit f707da40ec

View File

@@ -100,12 +100,12 @@ def get_data(filters=None):
@frappe.whitelist()
def update_batch_qty(selected_batches: str | None = None):
def update_batch_qty(selected_batches: str | list | None = None):
frappe.has_permission("Batch", "write", throw=True, ignore_share_permissions=True)
if not selected_batches:
return
selected_batches = json.loads(selected_batches)
selected_batches = frappe.parse_json(selected_batches)
for row in selected_batches:
batch_name = row.get("batch")