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)