Merge pull request #35791 from sokumon/menu-fixes

fix: various fixes
This commit is contained in:
Soham Kulkarni 2026-01-09 14:28:18 +05:30 committed by GitHub
commit 2a96c48637
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 17 additions and 4 deletions

View file

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

View file

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