mirror of
https://github.com/frappe/erpnext.git
synced 2026-08-13 14:41:53 +00:00
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:
@@ -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")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user