Skip to content

Commit

Permalink
fix: alert on fetch shift if no shift is found
Browse files Browse the repository at this point in the history
  • Loading branch information
asmitahase committed Jan 28, 2025
1 parent bd2e1f5 commit f38b61a
Showing 1 changed file with 15 additions and 8 deletions.
23 changes: 15 additions & 8 deletions hrms/hr/doctype/employee_checkin/employee_checkin.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,21 @@ frappe.ui.form.on("Employee Checkin", {
freeze: true,
freeze_message: __("Fetching Shift"),
callback: function () {
frm.dirty();
frm.save();
frappe.show_alert({
message: __("Shift has been successfully updated to {0}.", [
frm.doc.shift,
]),
indicator: "green",
});
if (frm.doc.shift) {
frappe.show_alert({
message: __("Shift has been successfully updated to {0}.", [
frm.doc.shift,
]),
indicator: "green",
});
frm.dirty();
frm.save();
} else {
frappe.show_alert({
message: __("No valid shift found for log time"),
indicator: "orange",
});
}
},
});
});
Expand Down

0 comments on commit f38b61a

Please sign in to comment.