From 8854f0c15315ddd8841f51100507592f50858dd1 Mon Sep 17 00:00:00 2001 From: Mihir Kandoi Date: Wed, 24 Jun 2026 20:37:35 +0530 Subject: [PATCH] feat!: send ERPNext requests as native JSON (use_json_request_body) Opt ERPNext into native application/json request bodies (frappe#40237). Non-GET requests to erpnext.* endpoints now send args as a JSON body instead of form-encoded, per-key JSON-stringified values. Safe after the preceding commits hardened every whitelisted endpoint with frappe.parse_json. --- erpnext/hooks.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/erpnext/hooks.py b/erpnext/hooks.py index 2b966df04d6..1ff17cac37d 100644 --- a/erpnext/hooks.py +++ b/erpnext/hooks.py @@ -712,6 +712,10 @@ default_log_clearing_doctypes = { export_python_type_annotations = True +# Send non-GET requests for ERPNext's endpoints as native `application/json` +# bodies instead of form-encoded, per-key JSON-stringified values. +use_json_request_body = True + fields_for_group_similar_items = ["qty", "amount"] # Translation