From 9e5e5ca1ea79140b72ce332943a628f35ae788e8 Mon Sep 17 00:00:00 2001 From: Rahul Agrawal <12agrawalrahul@gmail.com> Date: Fri, 26 Sep 2025 16:51:18 +0530 Subject: [PATCH] feat: add Make 'name' searchable in Global Search in custom form --- frappe/custom/doctype/customize_form/customize_form.json | 7 +++++++ frappe/custom/doctype/customize_form/customize_form.py | 4 ++++ 2 files changed, 11 insertions(+) diff --git a/frappe/custom/doctype/customize_form/customize_form.json b/frappe/custom/doctype/customize_form/customize_form.json index 4eb0593966..c41de205a5 100644 --- a/frappe/custom/doctype/customize_form/customize_form.json +++ b/frappe/custom/doctype/customize_form/customize_form.json @@ -44,6 +44,7 @@ "force_re_route_to_default_view", "column_break_29", "show_preview_popup", + "show_name_in_global_search", "email_settings_section", "default_email_template", "column_break_26", @@ -430,6 +431,12 @@ "fieldtype": "Int", "label": "Rows Threshold for Grid Search", "non_negative": 1 + }, + { + "default": "0", + "fieldname": "show_name_in_global_search", + "fieldtype": "Check", + "label": "Make \"name\" searchable in Global Search" } ], "hide_toolbar": 1, diff --git a/frappe/custom/doctype/customize_form/customize_form.py b/frappe/custom/doctype/customize_form/customize_form.py index f5061f3f52..1fa7a1c4aa 100644 --- a/frappe/custom/doctype/customize_form/customize_form.py +++ b/frappe/custom/doctype/customize_form/customize_form.py @@ -79,6 +79,7 @@ class CustomizeForm(Document): search_fields: DF.Data | None sender_field: DF.Data | None sender_name_field: DF.Data | None + show_name_in_global_search: DF.Check show_preview_popup: DF.Check show_title_field_in_link: DF.Check sort_field: DF.Literal[None] @@ -307,6 +308,8 @@ class CustomizeForm(Document): ) def set_property_setters_for_doctype(self, meta): + if self.get("show_name_in_global_search") != meta.get("show_name_in_global_search"): + self.flags.rebuild_doctype_for_global_search = True for prop, prop_type in doctype_properties.items(): if self.get(prop) != meta.get(prop): self.make_property_setter(prop, self.get(prop), prop_type) @@ -736,6 +739,7 @@ doctype_properties = { "track_views": "Check", "allow_auto_repeat": "Check", "allow_import": "Check", + "show_name_in_global_search": "Check", "show_preview_popup": "Check", "default_email_template": "Data", "email_append_to": "Check",