From 5543577ca7442d65d7b782b94ccdd08db3e68ae8 Mon Sep 17 00:00:00 2001 From: Mihir Kandoi Date: Wed, 24 Jun 2026 20:37:34 +0530 Subject: [PATCH] refactor: parse native JSON request args in selling/doctype/customer/customer.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/selling/doctype/customer/customer.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/erpnext/selling/doctype/customer/customer.py b/erpnext/selling/doctype/customer/customer.py index e8ba3eab04d..cb5e770b141 100644 --- a/erpnext/selling/doctype/customer/customer.py +++ b/erpnext/selling/doctype/customer/customer.py @@ -559,8 +559,7 @@ def check_credit_limit(customer, company, ignore_outstanding_sales_order=False, def send_emails( customer: str, customer_outstanding: float, credit_limit: float, credit_controller_users_list: str | list ): - if isinstance(credit_controller_users_list, str): - credit_controller_users_list = json.loads(credit_controller_users_list) + credit_controller_users_list = frappe.parse_json(credit_controller_users_list) subject = _("Credit limit reached for customer {0}").format(customer) message = _("Credit limit has been crossed for customer {0} ({1}/{2})").format( customer, customer_outstanding, credit_limit