mirror of
https://github.com/frappe/erpnext.git
synced 2026-08-31 23:33:43 +00:00
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.
This commit is contained in:
@@ -317,8 +317,8 @@ class InvoiceDiscounting(AccountsController):
|
|||||||
|
|
||||||
|
|
||||||
@frappe.whitelist()
|
@frappe.whitelist()
|
||||||
def get_invoices(filters: str):
|
def get_invoices(filters: str | dict):
|
||||||
filters = frappe._dict(json.loads(filters))
|
filters = frappe._dict(frappe.parse_json(filters))
|
||||||
si = frappe.qb.DocType("Sales Invoice")
|
si = frappe.qb.DocType("Sales Invoice")
|
||||||
di = frappe.qb.DocType("Discounted Invoice")
|
di = frappe.qb.DocType("Discounted Invoice")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user