diff --git a/frappe/patches/v16_0/change_link_type_to_workspace_sidebar.py b/frappe/patches/v16_0/change_link_type_to_workspace_sidebar.py index ed7167409b..32e2d2269f 100644 --- a/frappe/patches/v16_0/change_link_type_to_workspace_sidebar.py +++ b/frappe/patches/v16_0/change_link_type_to_workspace_sidebar.py @@ -2,10 +2,17 @@ import frappe def execute(): - desktop_icons = frappe.get_all("Desktop Icon", filters={"icon_type": "Link"}) + desktop_icons = frappe.get_all( + "Desktop Icon", + filters={ + "icon_type": "Link", + "link_type": ["in", ["Workspace", "DocType"]], + }, + ) + for icon in desktop_icons: icon_doc = frappe.get_doc("Desktop Icon", icon.name) - if icon_doc.link_type == "Workspace" and frappe.db.exists("Workspace Sidebar", icon.name): + if frappe.db.exists("Workspace Sidebar", icon.name): icon_doc.link_type = "Workspace Sidebar" icon_doc.link_to = icon.name icon_doc.save()