mirror of
https://github.com/frappe/erpnext.git
synced 2026-09-02 08:03:21 +00:00
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.
This commit is contained in:
@@ -222,8 +222,7 @@ def auto_fetch_serial_number(
|
|||||||
|
|
||||||
@frappe.whitelist()
|
@frappe.whitelist()
|
||||||
def get_pos_reserved_serial_nos(filters: str | dict):
|
def get_pos_reserved_serial_nos(filters: str | dict):
|
||||||
if isinstance(filters, str):
|
filters = frappe.parse_json(filters)
|
||||||
filters = json.loads(filters)
|
|
||||||
|
|
||||||
POSInvoice = frappe.qb.DocType("POS Invoice")
|
POSInvoice = frappe.qb.DocType("POS Invoice")
|
||||||
POSInvoiceItem = frappe.qb.DocType("POS Invoice Item")
|
POSInvoiceItem = frappe.qb.DocType("POS Invoice Item")
|
||||||
|
|||||||
Reference in New Issue
Block a user