fix: respect manual half_day_status when no leave record exists#4893
fix: respect manual half_day_status when no leave record exists#4893creative-paramu wants to merge 1 commit into
Conversation
When an attendance is marked Half Day with no approved half-day Leave Application, the status was always forced to Absent and the modify_half_day_status flag was reset, silently discarding a value the user set manually. Now Absent is only auto-applied when the user has not taken manual control (modify_half_day_status unchecked), so an explicit Present choice is preserved. Default and bulk marking remain unchanged. Fixes frappe#4866
1879acb to
002f5bd
Compare
Confidence Score: 4/5The change is narrow and well-scoped; default and bulk marking behaviour is unchanged. The two-line change correctly guards the forced 'Absent' assignment behind the existing modify_half_day_status flag. No tests are included for the new branch, so the preserved-status path is not automatically verified. hrms/hr/doctype/attendance/attendance.py — the new branch where modify_half_day_status is truthy has no corresponding test coverage. Reviews (1): Last reviewed commit: "fix: respect manual half_day_status when..." | Re-trigger Greptile |
|
Tick the box to add this pull request to the merge queue (same as
|
doesn't that mean the employee was not available for half day and hence the status for other half should be absent? |
You're right that by default it should be Absent, and this PR keeps that default unchanged. The change only matters when HR explicitly ticks "Modify Half Day Status" and sets it to Present. There are valid cases where the other half isn't a leave but the employee was still present — for example on-duty/official work, training, or a comp-off that isn't recorded as a Leave Application. Right now, even when HR ticks that box and chooses Present, the value is silently reset to Absent, so the checkbox has no effect when there's no leave record. So this doesn't change the default behaviour — without an approved leave it still defaults to Absent. It only makes the existing modify_half_day_status override actually work. |
When an attendance is marked Half Day with no approved half-day Leave Application, the status was always forced to Absent and the modify_half_day_status flag was reset, silently discarding a value the user set manually.
Now Absent is only auto-applied when the user has not taken manual control (modify_half_day_status unchecked), so an explicit Present choice is preserved. Default and bulk marking remain unchanged.
Fixes #4866