mirror of
https://github.com/frappe/erpnext.git
synced 2026-08-19 17:30:01 +00:00
refactor: parse native JSON request args in accounts/doctype/payment_entry/payment_entry.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:
@@ -1805,8 +1805,7 @@ class PaymentEntry(AccountsController):
|
||||
if not self.references or not matched_payment_requests:
|
||||
return
|
||||
|
||||
if isinstance(matched_payment_requests, str):
|
||||
matched_payment_requests = json.loads(matched_payment_requests)
|
||||
matched_payment_requests = frappe.parse_json(matched_payment_requests)
|
||||
|
||||
# modify matched_payment_requests
|
||||
# like (reference_doctype, reference_name, allocated_amount): payment_request
|
||||
@@ -2011,8 +2010,7 @@ def validate_inclusive_tax(tax, doc):
|
||||
|
||||
@frappe.whitelist()
|
||||
def get_outstanding_reference_documents(args: str | dict, validate: bool = False):
|
||||
if isinstance(args, str):
|
||||
args = json.loads(args)
|
||||
args = frappe.parse_json(args)
|
||||
|
||||
if args.get("party_type") == "Member":
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user