diff --git a/frappe/patches/v16_0/add_standard_field_in_workspace_sidebar.py b/frappe/patches/v16_0/add_standard_field_in_workspace_sidebar.py index f49bfe8cc8..abde1a97c6 100644 --- a/frappe/patches/v16_0/add_standard_field_in_workspace_sidebar.py +++ b/frappe/patches/v16_0/add_standard_field_in_workspace_sidebar.py @@ -5,8 +5,15 @@ from frappe.model.sync import check_if_record_exists def execute(): for sidebar in frappe.get_all("Workspace Sidebar", pluck="name"): sidebar_doc = frappe.get_doc("Workspace Sidebar", sidebar) + if sidebar_doc.app and check_if_record_exists( - "app", frappe.get_app_path(sidebar_doc.app), "Workspace Sidebar", sidebar_doc.name + "app", + frappe.get_app_path(sidebar_doc.app), + "Workspace Sidebar", + sidebar_doc.name, ): - sidebar_doc.standard = 1 - sidebar_doc.save() + try: + sidebar_doc.standard = 1 + sidebar_doc.save() + except Exception as e: + print("Error in setting standard field", e) diff --git a/frappe/public/js/frappe/ui/menu.js b/frappe/public/js/frappe/ui/menu.js index f2d3b77788..ea154bad89 100644 --- a/frappe/public/js/frappe/ui/menu.js +++ b/frappe/public/js/frappe/ui/menu.js @@ -155,7 +155,13 @@ frappe.ui.menu = class ContextMenu { }); me.hide(); me.opts.onHide && me.opts.onHide(me); - frappe.set_route(item.url); + if (item.url.startsWith("/desk")) { + frappe.set_route(item.url); + } else if (item.url.startsWith("/")) { + window.location.href = window.location.origin + item.url; + } else { + window.open(item.url, "_blank").focus(); + } }); } }