diff --git a/frappe/core/doctype/doctype/doctype.py b/frappe/core/doctype/doctype/doctype.py index e56803acb7..a965d9c1b2 100644 --- a/frappe/core/doctype/doctype/doctype.py +++ b/frappe/core/doctype/doctype/doctype.py @@ -1298,7 +1298,7 @@ def validate_fields(meta): frappe.throw(_("Is Published Field must be a valid fieldname"), InvalidFieldNameError) def check_website_search_field(meta): - if not meta.website_search_field: + if not meta.get("website_search_field"): return if meta.website_search_field not in fieldname_list: diff --git a/frappe/patches.txt b/frappe/patches.txt index 66422c7db0..425468f06c 100644 --- a/frappe/patches.txt +++ b/frappe/patches.txt @@ -121,7 +121,7 @@ execute:frappe.delete_doc_if_exists('DocType', 'GCalendar Settings') frappe.patches.v12_0.remove_example_email_thread_notify execute:from frappe.desk.page.setup_wizard.install_fixtures import update_genders;update_genders() frappe.patches.v12_0.set_correct_url_in_files -execute:frappe.reload_doc('core', 'doctype', 'doctype') +execute:frappe.reload_doc('core', 'doctype', 'doctype') #2022-06-21 execute:frappe.reload_doc('custom', 'doctype', 'property_setter') frappe.patches.v13_0.remove_invalid_options_for_data_fields frappe.patches.v13_0.website_theme_custom_scss @@ -190,7 +190,6 @@ frappe.patches.v14_0.transform_todo_schema frappe.patches.v14_0.remove_post_and_post_comment frappe.patches.v14_0.reset_creation_datetime frappe.patches.v14_0.remove_is_first_startup -frappe.patches.v14_0.reload_workspace_child_tables frappe.patches.v14_0.clear_long_pending_stale_logs frappe.patches.v14_0.log_settings_migration diff --git a/frappe/patches/v14_0/reload_workspace_child_tables.py b/frappe/patches/v14_0/reload_workspace_child_tables.py deleted file mode 100644 index c22774d94c..0000000000 --- a/frappe/patches/v14_0/reload_workspace_child_tables.py +++ /dev/null @@ -1,13 +0,0 @@ -import frappe - - -def execute(): - child_tables = frappe.get_all( - "DocField", - pluck="options", - filters={"fieldtype": ["in", frappe.model.table_fields], "parent": "Workspace"}, - ) - - for child_table in child_tables: - if child_table != "Has Role": - frappe.reload_doc("desk", "doctype", child_table, force=True) diff --git a/frappe/patches/v14_0/update_workspace2.py b/frappe/patches/v14_0/update_workspace2.py index c6586f46a1..a6c9db503f 100644 --- a/frappe/patches/v14_0/update_workspace2.py +++ b/frappe/patches/v14_0/update_workspace2.py @@ -7,6 +7,16 @@ from frappe import _ def execute(): frappe.reload_doc("desk", "doctype", "workspace", force=True) + child_tables = frappe.get_all( + "DocField", + pluck="options", + filters={"fieldtype": ["in", frappe.model.table_fields], "parent": "Workspace"}, + ) + + for child_table in child_tables: + if child_table != "Has Role": + frappe.reload_doc("desk", "doctype", child_table, force=True) + for seq, workspace in enumerate(frappe.get_all("Workspace", order_by="name asc")): doc = frappe.get_doc("Workspace", workspace.name) content = create_content(doc)