fix: fix ux for print preview page (#17087)
Co-authored-by: Shariq Ansari <sharique.rik@gmail.com>
This commit is contained in:
parent
d9f9ef28de
commit
b04af618f2
1 changed files with 13 additions and 1 deletions
|
|
@ -19,7 +19,8 @@ frappe.pages['print'].on_page_load = function(wrapper) {
|
|||
});
|
||||
});
|
||||
} else {
|
||||
print_view.frm = frappe.route_options.frm;
|
||||
print_view.frm = frappe.route_options.frm.doctype ?
|
||||
frappe.route_options.frm : frappe.route_options.frm.frm;
|
||||
frappe.route_options.frm = null;
|
||||
print_view.show(print_view.frm);
|
||||
}
|
||||
|
|
@ -85,6 +86,10 @@ frappe.ui.form.PrintView = class {
|
|||
() => this.refresh_print_format(),
|
||||
{ icon: 'refresh' }
|
||||
);
|
||||
|
||||
this.page.add_action_icon("file", () => {
|
||||
this.go_to_form_view();
|
||||
}, '', __("Form"));
|
||||
}
|
||||
|
||||
setup_sidebar() {
|
||||
|
|
@ -498,6 +503,13 @@ frappe.ui.form.PrintView = class {
|
|||
}
|
||||
}
|
||||
|
||||
go_to_form_view() {
|
||||
frappe.route_options = {
|
||||
frm: this,
|
||||
};
|
||||
frappe.set_route('Form', this.frm.doctype, this.frm.docname);
|
||||
}
|
||||
|
||||
show_footer() {
|
||||
// footer is hidden by default as reqd by pdf generation
|
||||
// simple hack to show it in print preview
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue