Enforce Clustox Leave Policy v1.3 rules on leave applications - #18
Open
hamad-clustox wants to merge 1 commit into
Open
hamad-clustox wants to merge 1 commit into
hamad-clustox wants to merge 1 commit into
Conversation
…tions Server-side validations (hrms/leave_rules.py, wired via hooks.py doc_events) that Frappe does not enforce natively: - advance notice (Annual 3/30, Religious 15, Marriage 45, Hajj 60); same-day and backdated requests are exempt as emergencies - gender restriction (Maternity = Female, Paternity = Male) - Hajj/Umrah once per employment - probation (first 90 days): Casual blocked, Sick capped at 2 - no leave during the notice / resignation period - Casual cannot be combined with another leave or an adjacent holiday - sandwich leave (leave immediately before AND after a holiday) blocked - medical proof (attachment) required for Sick Leave over 2 days - Compensatory Off expires 1 month after it is earned Hard block, but HR Manager / HR User / System Manager / Administrator override. Verified with 17 in-memory cases before activating on the test server. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Server-side enforcement of the leave rules from Leave Policy v1.3 that Frappe doesn't enforce natively — a new
hrms/leave_rules.pymodule wired throughhooks.pydoc_eventson Leave Application and Leave Allocation.Rules enforced (on
/hrmsPWA, desk, and API alike)relieving_dateis set.before_submit).Enforcement = hard block, but HR Manager / HR User / System Manager / Administrator override (for approved exceptions / emergencies).
Verification
17 in-memory cases exercised before activation on the test server (notice, gender, once, emergency exemption, medical-proof-on-submit, override bypass, comp-off cap) — all passed. Now live.
Notes
hooks.pyedit touches only thedoc_eventsdict; independent of Per-user app landing (supersedes #14) #17'srole_home_pageedit (different region), so they merge cleanly.🤖 Generated with Claude Code