fix: cleanup desktop icons in migrate

This commit is contained in:
sokumon 2026-01-21 16:51:47 +05:30
parent 3723e5e0a5
commit 1357924b05
2 changed files with 2 additions and 12 deletions

View file

@ -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()

View file

@ -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)