From 1d571827cf396f849a9ef02d72bcb7129b4cd8f1 Mon Sep 17 00:00:00 2001 From: Abdeali Chharchhoda Date: Fri, 24 Apr 2026 12:01:34 +0530 Subject: [PATCH] chore: clear cache after deleting custom fields --- frappe/custom/doctype/custom_field/custom_field.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/frappe/custom/doctype/custom_field/custom_field.py b/frappe/custom/doctype/custom_field/custom_field.py index ccc30fc3d2..0f400d07a5 100644 --- a/frappe/custom/doctype/custom_field/custom_field.py +++ b/frappe/custom/doctype/custom_field/custom_field.py @@ -483,6 +483,7 @@ def delete_custom_fields(custom_fields: dict, bypass_hooks: bool = False): "dt": doctype, }, ) + frappe.clear_cache(doctype=doctype) else: custom_field_names = frappe.get_all( "Custom Field", @@ -492,5 +493,3 @@ def delete_custom_fields(custom_fields: dict, bypass_hooks: bool = False): for custom_field_name in custom_field_names: frappe.get_doc("Custom Field", custom_field_name).delete(ignore_permissions=True, force=True) - - frappe.clear_cache(doctype=doctype)