fix: In global search property from customize form is not working (#7261)
This commit is contained in:
parent
e8d5872eb7
commit
2f0201e8e1
1 changed files with 9 additions and 0 deletions
|
|
@ -149,6 +149,7 @@ class CustomizeForm(Document):
|
|||
return
|
||||
|
||||
self.flags.update_db = False
|
||||
self.flags.rebuild_doctype_for_global_search = False
|
||||
|
||||
self.set_property_setters()
|
||||
self.update_custom_fields()
|
||||
|
|
@ -164,6 +165,10 @@ class CustomizeForm(Document):
|
|||
frappe.clear_cache(doctype=self.doc_type)
|
||||
self.fetch_to_customize()
|
||||
|
||||
if self.flags.rebuild_doctype_for_global_search:
|
||||
frappe.enqueue('frappe.utils.global_search.rebuild_for_doctype',
|
||||
now=True, doctype=self.doc_type)
|
||||
|
||||
def set_property_setters(self):
|
||||
meta = frappe.get_meta(self.doc_type)
|
||||
# doctype property setters
|
||||
|
|
@ -224,6 +229,10 @@ class CustomizeForm(Document):
|
|||
frappe.msgprint(_("You can't set 'Translatable' for field {0}").format(df.label))
|
||||
continue
|
||||
|
||||
elif (property == 'in_global_search' and
|
||||
df.in_global_search != meta_df[0].get("in_global_search")):
|
||||
self.flags.rebuild_doctype_for_global_search = True
|
||||
|
||||
self.make_property_setter(property=property, value=df.get(property),
|
||||
property_type=docfield_properties[property], fieldname=df.fieldname)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue