From ddd57ca12e6378abca197f259d3885935ba4eaa1 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/doctype/serial_no/serial_no.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. --- erpnext/stock/doctype/serial_no/serial_no.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/erpnext/stock/doctype/serial_no/serial_no.py b/erpnext/stock/doctype/serial_no/serial_no.py index 6ea89b2db8b..a8d9b9f1e7d 100644 --- a/erpnext/stock/doctype/serial_no/serial_no.py +++ b/erpnext/stock/doctype/serial_no/serial_no.py @@ -222,8 +222,7 @@ def auto_fetch_serial_number( @frappe.whitelist() def get_pos_reserved_serial_nos(filters: str | dict): - if isinstance(filters, str): - filters = json.loads(filters) + filters = frappe.parse_json(filters) POSInvoice = frappe.qb.DocType("POS Invoice") POSInvoiceItem = frappe.qb.DocType("POS Invoice Item")