Skip to content

Commit

Permalink
fix(UX): warning when printing unsaved documents (#26229) (#26232)
Browse files Browse the repository at this point in the history
(cherry picked from commit 99e4f55)

Co-authored-by: Ankush Menat <ankush@frappe.io>
  • Loading branch information
mergify[bot] and ankush committed Apr 30, 2024
1 parent 9490869 commit 8826690
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions frappe/public/js/frappe/form/form.js
Original file line number Diff line number Diff line change
Expand Up @@ -1234,6 +1234,15 @@ frappe.ui.form.Form = class FrappeForm {
// ACTIONS

print_doc() {
if (this.is_dirty()) {
frappe.toast({
message: __(
"This document has unsaved changes which might not appear in final PDF. <br> Consider saving the document before printing."
),
indicator: "yellow",
});
}

frappe.route_options = {
frm: this,
};
Expand Down

0 comments on commit 8826690

Please sign in to comment.