Compensatory Leave Allocation

Hi everyone,

I’m trying to implement an automated compensatory leave allocation in Frappe HR (ERPNext). The requirement is:

If an employee works continuously for 7 days without a day off, the system should automatically allocate a compensatory leave for the following week.

Could anyone guide me on:

  • Is there a built-in configuration in Frappe HR / Leave Management to handle this scenario?
  • If not, what would be the recommended approach — a custom script, a scheduled job, or a leave policy rule?
  • Which DocTypes would be involved (e.g., Attendance, Leave Allocation, Compensatory Leave Request)?

Any pointers or examples would be greatly appreciated. Thank you!

Hi Aswani,

In standard Frappe HR / ERPNext, there is no such rule that automatically grants compensatory leave based on “7 consecutive working days” logic. The native Leave Management module mainly handles manual leave applications, leave policies, allocations, and optional Compensatory Leave Requests depending on your setup…

one important to note down before proceeding is that you should define clearly whether the logic means:

“7 consecutive calendar days” OR “7 consecutive assigned working days”

This distinction becomes very important when shifts, holidays, and rotational offs are involved.

I generally recommend using a scheduled server-side job instead of client scripts or workflow conditions for this kind of requirement. The reason is that attendance data can change retroactively (late check-ins, imports, corrections, biometric syncs, etc.), and scheduled jobs provide much better control and auditability.

2 Likes