From ecbf8632aa71db3ebd3c166e19dd5d0a0ac9156c Mon Sep 17 00:00:00 2001 From: Mihir Kandoi Date: Wed, 24 Jun 2026 20:37:31 +0530 Subject: [PATCH] refactor: parse native JSON request args in accounts/doctype/invoice_discounting/invoice_discounting.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. --- .../doctype/invoice_discounting/invoice_discounting.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/erpnext/accounts/doctype/invoice_discounting/invoice_discounting.py b/erpnext/accounts/doctype/invoice_discounting/invoice_discounting.py index 3e2f18e1f41..bf4f9e072d0 100644 --- a/erpnext/accounts/doctype/invoice_discounting/invoice_discounting.py +++ b/erpnext/accounts/doctype/invoice_discounting/invoice_discounting.py @@ -317,8 +317,8 @@ class InvoiceDiscounting(AccountsController): @frappe.whitelist() -def get_invoices(filters: str): - filters = frappe._dict(json.loads(filters)) +def get_invoices(filters: str | dict): + filters = frappe._dict(frappe.parse_json(filters)) si = frappe.qb.DocType("Sales Invoice") di = frappe.qb.DocType("Discounted Invoice")