Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: show validation message before changing shift start time #2742

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

asmitahase
Copy link
Collaborator

@asmitahase asmitahase commented Jan 31, 2025

Problem

Shift start time is recorded in the Employee checkins which is then used to sort the logs chronologically to mark attendance.
If this is time is changed mid shift, check in and check out logs get a different shift start which results in incorrect attendance records


Before

Screen.Recording.2025-02-01.at.12.26.54.AM.mov

After

Screen.Recording.2025-02-01.at.1.13.57.AM.mov

Solution

Show a validation before changing start time to mark attendance for unlinked logs.

@asmitahase
Copy link
Collaborator Author

@ruchamahabal, is better way to just call fetch shift on the logs after start time is changed?

if self.is_field_modified("start_time") and self.unlinked_checkins_exist():
frappe.throw(
title=_("Unmarked Check-in Logs Found"),
msg=_("Mark attendance for exsiting check-in/out logs before changing shift settings"),
Copy link
Member

@ruchamahabal ruchamahabal Jan 31, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
msg=_("Mark attendance for exsiting check-in/out logs before changing shift settings"),
msg=_("Mark attendance for existing check-in/out logs before changing shift settings"),

Typo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants