fix(patch): include icons where link type is doctype

This commit is contained in:
sokumon 2026-01-02 18:01:29 +05:30
parent e7c77b9ce9
commit f5ea989d2b

View file

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