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

refactor: fetch all employees that may have shift type as active shift #2683

Merged
merged 8 commits into from
Jan 23, 2025

Conversation

asmitahase
Copy link
Collaborator

@asmitahase asmitahase commented Jan 22, 2025

Problem

Some employees would miss out while marking attendance for a shift due to filters set to exclude employees that have any other active shift assignment.
#2602 was pushed to rectify this, but it would exclude employees with the same active and default shift (this is a whole other can of worms) entirely.


Solution

Refactored to fetch all such employees who either have shift in question assigned that hasn't ended or have this shift as default shift. This may fetch some redundant employees who have another shift assigned that may have started or ended before or after the attendance processing date.
But this is done to avoid missing any employee who may have this shift as active shift.
Had added a test case with #2602.
Improved test scenario for

def test_mark_absent_for_dates_with_no_attendance_for_midnight_shift(self):

Caveats

Could affect performance but better than having incorrect attendance records?

@asmitahase asmitahase marked this pull request as ready for review January 22, 2025 07:42
@asmitahase asmitahase marked this pull request as draft January 22, 2025 15:20
@asmitahase asmitahase marked this pull request as ready for review January 22, 2025 15:30
@asmitahase asmitahase merged commit 176b594 into frappe:develop Jan 23, 2025
7 checks passed
asmitahase added a commit that referenced this pull request Jan 23, 2025
…2683

refactor(Shift Type): fetch all employees that may have shift type as active shift (backport #2683)
asmitahase added a commit that referenced this pull request Jan 23, 2025
…2683

refactor(Shift Type): fetch all employees that may have shift type as active shift (backport #2683)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant