diff --git a/frappe/desk/doctype/desktop_icon/desktop_icon.py b/frappe/desk/doctype/desktop_icon/desktop_icon.py index c7a3e9c764..358fc4dff3 100644 --- a/frappe/desk/doctype/desktop_icon/desktop_icon.py +++ b/frappe/desk/doctype/desktop_icon/desktop_icon.py @@ -221,7 +221,6 @@ def create_desktop_icons_from_workspace(): icon.link_type = "Workspace Sidebar" icon.label = w.name icon.icon_type = "Link" - icon.standard = 1 icon.link_to = w.name icon.icon = w.icon if w.module: @@ -267,7 +266,6 @@ def create_desktop_icons_from_installed_apps(): icon = frappe.new_doc("Desktop Icon") icon.label = app_title icon.link_type = "External" - icon.standard = 1 icon.idx = index icon.icon_type = "App" icon.app = a @@ -281,3 +279,7 @@ def create_desktop_icons_from_installed_apps(): def create_desktop_icons(): create_desktop_icons_from_installed_apps() create_desktop_icons_from_workspace() + + +def create_user_icons(user, data): + print("Hello") diff --git a/frappe/patches.txt b/frappe/patches.txt index 8e3157f7f9..6927692b4c 100644 --- a/frappe/patches.txt +++ b/frappe/patches.txt @@ -256,3 +256,4 @@ frappe.patches.v16_0.change_link_type_to_workspace_sidebar frappe.patches.v16_0.add_standard_field_in_workspace_sidebar execute:frappe.db.set_single_value("Desktop Settings", "icon_style", "Solid") execute:frappe.delete_doc_if_exists("Workspace Sidebar", "Productivity") +frappe.patches.v16_0.unset_standard_field_for_auto_generated_icons diff --git a/frappe/patches/v16_0/unset_standard_field_for_auto_generated_icons.py b/frappe/patches/v16_0/unset_standard_field_for_auto_generated_icons.py new file mode 100644 index 0000000000..e12f34cf7c --- /dev/null +++ b/frappe/patches/v16_0/unset_standard_field_for_auto_generated_icons.py @@ -0,0 +1,18 @@ +import frappe +from frappe.model.sync import check_if_record_exists + + +def execute(): + for icon in frappe.get_all("Desktop Icon"): + icon_doc = frappe.get_doc("Desktop Icon", icon.name) + if (icon_doc.standard and icon_doc.app) and not check_if_record_exists( + "app", + frappe.get_app_path(icon_doc.app), + "Desktop Icon", + icon_doc.name, + ): + try: + icon_doc.standard = 0 + icon_doc.save() + except Exception as e: + print("Error in unsetting standard field", e)