diff --git a/frappe/patches.txt b/frappe/patches.txt index 93cb29f3f9..f7e6ba6d5d 100644 --- a/frappe/patches.txt +++ b/frappe/patches.txt @@ -253,3 +253,4 @@ frappe.patches.v16_0.add_private_workspaces_to_sidebar frappe.core.doctype.communication_link.patches.copy_communication_date_to_link frappe.core.doctype.communication.patches.drop_ref_dt_dn_index frappe.patches.v16_0.change_link_type_to_workspace_sidebar +frappe.patches.v16_0.add_standard_field_in_workspace_sidebar \ No newline at end of file diff --git a/frappe/patches/v16_0/add_standard_field_in_workspace_sidebar.py b/frappe/patches/v16_0/add_standard_field_in_workspace_sidebar.py new file mode 100644 index 0000000000..f49bfe8cc8 --- /dev/null +++ b/frappe/patches/v16_0/add_standard_field_in_workspace_sidebar.py @@ -0,0 +1,12 @@ +import frappe +from frappe.model.sync import check_if_record_exists + + +def execute(): + for sidebar in frappe.get_all("Workspace Sidebar", pluck="name"): + sidebar_doc = frappe.get_doc("Workspace Sidebar", sidebar) + if sidebar_doc.app and check_if_record_exists( + "app", frappe.get_app_path(sidebar_doc.app), "Workspace Sidebar", sidebar_doc.name + ): + sidebar_doc.standard = 1 + sidebar_doc.save()