fix: load correct sidebar for printview
This commit is contained in:
parent
6e51dc3f67
commit
6075e557df
2 changed files with 4 additions and 0 deletions
|
|
@ -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);
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -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) => {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue