fix: load correct sidebar for printview

This commit is contained in:
sokumon 2026-01-08 09:05:40 +05:30
parent 6e51dc3f67
commit 6075e557df
2 changed files with 4 additions and 0 deletions

View file

@ -24,6 +24,8 @@ frappe.pages["print"].on_page_load = function (wrapper) {
? frappe.route_options.frm
: frappe.route_options.frm.frm;
frappe.route_options.frm = null;
let meta = print_view.frm.meta;
meta.module && frappe.app.sidebar.show_sidebar_for_module(meta.module);
print_view.show(print_view.frm);
}
});

View file

@ -417,6 +417,7 @@ frappe.ui.Sidebar = class Sidebar {
}
let sidebars = this.get_correct_workspace_sidebars(entity_name);
this.preffered_sidebars = sidebars;
let module = router?.meta?.module;
if (this.sidebar_title && sidebars.includes(this.sidebar_title)) {
this.set_active_workspace_item();
@ -441,6 +442,7 @@ frappe.ui.Sidebar = class Sidebar {
this.set_active_workspace_item();
}
show_sidebar_for_module(module) {
if (this.sidebar_title != module) return;
let sidebars =
this.sidebar_module_map[module] &&
this.sidebar_module_map[module].sort((a, b) => {