From d87b87b1e6a4c62e5ea06c25260940946c94098e Mon Sep 17 00:00:00 2001 From: sokumon Date: Sun, 2 Nov 2025 16:44:06 +0530 Subject: [PATCH] fix: added some debugging statements --- .../desk/doctype/desktop_icon/desktop_icon.py | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/frappe/desk/doctype/desktop_icon/desktop_icon.py b/frappe/desk/doctype/desktop_icon/desktop_icon.py index e062ebd268..95dba2fa75 100644 --- a/frappe/desk/doctype/desktop_icon/desktop_icon.py +++ b/frappe/desk/doctype/desktop_icon/desktop_icon.py @@ -645,8 +645,21 @@ def create_desktop_icons_from_workspace(): ): icon.hidden = 1 icon.parent_icon = None - if not frappe.db.exists("Desktop Icon", [{"label": icon.label, "link_type": icon.link_type}]): - icon.insert(ignore_if_duplicate=True) + print(f"Label {icon.label}") + print(f"Icon Type {icon.icon_type}") + print(f"Link Type {icon.link_type}") + try: + if not frappe.db.exists("Desktop Icon", [{"label": icon.label, "icon_type": icon.icon_type}]): + icon.insert(ignore_if_duplicate=True) + except Exception as e: + print(f"Error occurred while inserting icon: {e}") + existing_icon = frappe.db.exists("Desktop Icon", [{"label": icon.label}]) + if existing_icon: + old_icon = frappe.get_doc("Desktop Icon", existing_icon) + print("Existing Icon Found:") + print(f"Label {old_icon.label}") + print(f"Icon Type {old_icon.icon_type}") + print(f"Link Type {old_icon.link_type}") def generate_color():