Leave balances are a trust problem
Ask five employees how much leave they have left and you’ll get five confident answers. Ask HR and you’ll get a spreadsheet with a tab called “FINAL v3” and a note about someone’s carry-forward from 2023.
Leave isn’t hard to calculate. The trouble is that employees don’t believe the balance HR gives them, so every request becomes a negotiation. A leave management system fixes that only if the rules inside it are the same ones in the employee handbook, applied the same way to everyone.
What a leave management system in ERPNext or Odoo covers already
More than most people expect, and we’d rather you used it than paid for code you don’t need.
In Frappe HR (the HR app that runs alongside ERPNext), Leave Types define whether leave is paid, carried forward or encashable. A Leave Policy bundles entitlements, and a Leave Policy Assignment gives them to an employee for a leave period. Earned leave accrues monthly through a scheduled job. Holiday Lists keep public holidays out of the day count, and a Leave Block List closes specific dates for a department or company, with named people allowed through. Balances are tracked through Leave Ledger Entries, so there’s a history behind every number.
Odoo’s Time Off app is part of Community. It has leave types, allocations, accrual plans with carry-forward rules, and a team calendar managers actually look at.
What neither does out of the box is reason about headcount. A Leave Block List says “not on these days”. It can’t say “no more than two people at once”.
Worked example: holding the line in peak season
Picture a customer support team of 60 agents split across four departments. November to early January is their busiest period, and everyone wants the same fortnight off.
The policy they already have on paper:
- Agents earn 1.5 days a month, 18 days a year. Up to 10 unused days carry into the next year. The rest expire.
- From 15 November to 10 January, no more than 2 people from the same department may be away on any overlapping dates.
- Requests over 5 consecutive days go to HR after the team lead approves.
Accrual and carry-forward are standard configuration, so erpfly generates a Leave Type and a Leave Policy as fixtures rather than code. The cover rule needs code, and that’s the function on this page, hooked to Leave Application through doc_events.
Now watch it work. In the Billing department, Hana has approved leave from 22 to 31 December. Tariq applied for 24 to 28 December, still open. On 3 November, Luis applies for 27 December to 2 January. Two people already overlap his dates, the limit is 2, so his application won’t save and the message tells him why. He picks 3 to 9 January instead, when the rest of Billing is back at work. No manager had to be the bad guy.
Open requests count toward the limit on purpose. Otherwise two people apply on the same morning, both look fine, and the manager approves both before lunch.
Leave rules we’d argue with
Different accrual maths for every employee. If you have 14 leave policies for 60 people, the handbook is the thing to fix. Group them.
Hard blocks with no escape hatch. Family emergencies don’t check the cover calendar. Give HR a role that can override with a reason.
Negative balances by default. Letting people borrow future leave sounds kind until someone resigns owing eight days. Allow it per case, not for everyone.
Syncing leave into three calendars. Pushing approved leave to one shared calendar is useful. Two-way sync with personal calendars fills personal calendars with duplicate events that pile up for months.
Where leave fits in HR
Approved leave should stop someone being marked absent in attendance management, and unpaid days need to reach the salary slip in HR and payroll. If you’re on ERPNext and wondering whether a rule like this belongs in a Server Script or a proper app, see Server Scripts vs a custom app. For wider changes to your setup, start with ERPNext customization or Odoo customization.