Skip to content

fix: respect manual half_day_status when no leave record exists#4893

Open
creative-paramu wants to merge 1 commit into
frappe:developfrom
creative-paramu:fix/half-day-status-respect-manual-override
Open

fix: respect manual half_day_status when no leave record exists#4893
creative-paramu wants to merge 1 commit into
frappe:developfrom
creative-paramu:fix/half-day-status-respect-manual-override

Conversation

@creative-paramu

Copy link
Copy Markdown
Contributor

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

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
@creative-paramu
creative-paramu force-pushed the fix/half-day-status-respect-manual-override branch from 1879acb to 002f5bd Compare July 13, 2026 07:05
@greptile-apps

greptile-apps Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Confidence Score: 4/5

The 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

@mergify

mergify Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

@asmitahase

asmitahase commented Jul 13, 2026

Copy link
Copy Markdown
Member

When an attendance is marked Half Day with no approved half-day Leave Application

doesn't that mean the employee was not available for half day and hence the status for other half should be absent?

@creative-paramu

Copy link
Copy Markdown
Contributor Author

When an attendance is marked Half Day with no approved half-day Leave Application

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.

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.

half_day_status automatically changes from Present to Absent after saving Half Day Attendance

2 participants