From 1357924b058a6c1bcf81deccdfbc6807b6322dca Mon Sep 17 00:00:00 2001 From: sokumon Date: Wed, 21 Jan 2026 16:51:47 +0530 Subject: [PATCH] fix: cleanup desktop icons in migrate --- .../doctype/workspace_sidebar/workspace_sidebar.py | 11 ----------- frappe/model/sync.py | 3 ++- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/frappe/desk/doctype/workspace_sidebar/workspace_sidebar.py b/frappe/desk/doctype/workspace_sidebar/workspace_sidebar.py index d21d79030a..02c3e61edb 100644 --- a/frappe/desk/doctype/workspace_sidebar/workspace_sidebar.py +++ b/frappe/desk/doctype/workspace_sidebar/workspace_sidebar.py @@ -73,7 +73,6 @@ class WorkspaceSidebar(Document): if is_workspace_manager(): if frappe.conf.developer_mode and self.app: self.delete_file() - self.delete_desktop_icon() else: frappe.throw(_("You need to be Workspace Manager to delete a public workspace.")) @@ -132,16 +131,6 @@ class WorkspaceSidebar(Document): if counts and counts.most_common(1)[0]: return counts.most_common(1)[0][0] - def delete_desktop_icon(self): - desktop_icon = frappe.get_all( - "Desktop Icon", - filters=[{"link_type": "Workspace Sidebar"}, {"link_to": self.name}], - limit=1, - pluck="name", - ) - if desktop_icon: - frappe.delete_doc("Desktop Icon", desktop_icon[0]) - def get_allowed_modules(self): if not self.user.allow_modules: self.user.build_permissions() diff --git a/frappe/model/sync.py b/frappe/model/sync.py index 73cf16a616..8054082249 100644 --- a/frappe/model/sync.py +++ b/frappe/model/sync.py @@ -201,13 +201,14 @@ def remove_orphan_doctypes(): def remove_orphan_entities(): entites = ["Workspace", "Dashboard", "Page", "Report"] - app_level_entities = ["Workspace Sidebar"] + app_level_entities = ["Workspace Sidebar", "Desktop Icon"] entity_filter_map = { "Workspace": {"public": 1}, "Page": {"standard": "Yes"}, "Report": {"is_standard": "Yes"}, "Dashboard": {"is_standard": True}, "Workspace Sidebar": {"standard": True}, + "Desktop Icon": {"standard": True}, } entity_file_map = create_entity_file_map(entites)