Skip to content

Commit

Permalink
feat: show alert when shift is updated
Browse files Browse the repository at this point in the history
  • Loading branch information
krantheman committed Aug 14, 2024
1 parent 95786ce commit e78e86b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions hrms/hr/doctype/employee_checkin/employee_checkin.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,22 @@ frappe.ui.form.on("Employee Checkin", {

add_fetch_shift_button(frm) {
frm.add_custom_button(__("Fetch Shift"), function () {
const previous_shift = frm.doc.shift;
frappe.call({
method: "fetch_shift",
doc: frm.doc,
freeze: true,
freeze_message: __("Fetching Shift"),
callback: function () {
if (previous_shift === frm.doc.shift) return;
frm.dirty();
frm.save();
frappe.show_alert({
message: __("Shift has been successfully updated to {0}.", [
frm.doc.shift,
]),
indicator: "green",
});
},
});
});
Expand Down

0 comments on commit e78e86b

Please sign in to comment.