fix: fix ux for print preview page (#17087)

Co-authored-by: Shariq Ansari <sharique.rik@gmail.com>
This commit is contained in:
Vishal Dhayagude 2022-06-08 14:58:06 +05:30 committed by GitHub
parent d9f9ef28de
commit b04af618f2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

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