From f707da40ec1e37e9a9c78d7e04781cfc4d90dbd6 Mon Sep 17 00:00:00 2001 From: Mihir Kandoi Date: Wed, 24 Jun 2026 20:37:35 +0530 Subject: [PATCH] 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. --- .../report/stock_qty_vs_batch_qty/stock_qty_vs_batch_qty.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/erpnext/stock/report/stock_qty_vs_batch_qty/stock_qty_vs_batch_qty.py b/erpnext/stock/report/stock_qty_vs_batch_qty/stock_qty_vs_batch_qty.py index 83ff83e869d..46c0c5da4ea 100644 --- a/erpnext/stock/report/stock_qty_vs_batch_qty/stock_qty_vs_batch_qty.py +++ b/erpnext/stock/report/stock_qty_vs_batch_qty/stock_qty_vs_batch_qty.py @@ -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")