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 (backport #2683) #2688

Merged
merged 5 commits into from
Jan 23, 2025

Conversation

mergify[bot]
Copy link
Contributor

@mergify mergify bot commented Jan 23, 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?


This is an automatic backport of pull request #2683 done by Mergify.

…t to be considered for attendance

(cherry picked from commit 9bd360f)
(cherry picked from commit 91c29a8)
chore: better test scenario

(cherry picked from commit bb80a0e)
…e the field is made mandatory for auto attendance

(cherry picked from commit 11623cc)
@mergify mergify bot requested a review from ruchamahabal as a code owner January 23, 2025 05:28
@asmitahase asmitahase merged commit 5d50429 into version-15-hotfix Jan 23, 2025
8 checks passed
@frappe-pr-bot
Copy link
Collaborator

🎉 This PR is included in version 15.38.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

2 participants