Overtime, Approved and Compensated
Auto-detect overtime from attendance, route it through a group-gated approval workflow, and compensate it as pay or time off in lieu, all on the EH HR Platform engines.
Why this module
Overtime, Approved and Compensated
One workflow engine, not five
The overtime model declares a workflow code and inherits the platform workflow, audit, and company-scope mixins. It contains no state machine, no approval logic, and no audit code of its own, so behavior stays consistent with every other HR document and there is one engine to harden, not one per app.
Overtime comes from the attendance you already have
A generation service reads the attendance day projection and creates one overtime entry per day that carries overtime minutes, converting minutes to hours. It is idempotent: a day that already has an entry is skipped, and a unique database constraint makes the one-entry-per-day rule structural, not just procedural.
The multiplier is data
The pay or time-in-lieu multiplier is a field with a default, not a constant buried in code, and compensated hours recompute as hours times multiplier. Compensation is chosen per entry as paid or time off in lieu, so different rules per shift or policy never require a code change.
Day in the life
From clocked hours to compensated overtime
An employee works past their scheduled hours and the attendance day projection records the overtime minutes. The generation service is run for the period and creates a draft overtime entry for that day, already linked back to its attendance day and stamped as auto-sourced. The employee (or a manager) reviews the hours, multiplier, and whether it is paid or taken as time off in lieu, then submits. A manager approves or refuses; on approval, the entry is marked compensated. Every step writes a tracked message to the record and an immutable row to the platform audit log, and the whole record stays scoped to the company that owns it. Ad hoc overtime that never went through attendance is entered by hand and follows the exact same path.
Edge cases
The cases most modules quietly ignore.
In the shipped code today, each one a place where a cheaper module silently does the wrong thing.
Re-running generation over the same date range creates nothing the second time. The service skips any attendance day that already has an entry, and a unique constraint on the attendance day makes the rule hold even under concurrent or repeated runs.
Every create, write, and unlink emits a row to an append-only, hash-chained audit log. Each row hashes the previous row's hash, so any silent edit downstream is detectable by a chain verification pass. Appends take a transaction-scoped Postgres advisory lock, so concurrent writers cannot fork the chain.
Records default to the acting user's company and company is required. Repointing an entry to a company the user is not a member of is refused, even under elevated rights, unless an explicit, audited override context is set, and the elevation itself is written to the audit trail.
Compensated and refused are terminal. The workflow engine refuses any further transition out of a final state, even one a misconfigured definition might declare, so an entry cannot be reopened or double-compensated by replaying a button.
Each transition is gated by the groups declared on it. Submit is open to self-service employees; approve, refuse, and mark-compensated require the HR manager group. A user outside a transition's groups is rejected with a clear error rather than silently allowed.
A database check constraint forbids negative overtime hours, so a bad import or a fat-fingered manual entry fails at the storage layer rather than producing a negative compensable value.
What is inside
Built to do the job, end to end.
- Overtime model. eh.hr.overtime with employee, date, hours, source (auto or manual), the originating attendance day, multiplier, compensation type (paid or time off in lieu), reason, and computed compensated hours. Auto-numbered from a yearly sequence and tracked on the chatter.
- Generation service. An on-demand service that scans the attendance day projection for a date range, optionally scoped to one company, and creates one overtime entry per day with overtime minutes. Idempotent and safe to re-run.
- Group-gated workflow. A configurable definition with draft, submitted, approved, compensated, and refused states and the transitions between them, each restricted to the groups allowed to fire it. States and order come from data, so steps can be reconfigured without code.
- Platform mixins. Workflow, append-only hash-chained audit, and strict multi-company mixins inherited from the shared HR platform, plus mail thread tracking. The module adds the overtime fields and thin transition buttons; the engines do the rest.
- Security and views. Access rules for HR admin, manager, and self-service employee groups, a list and form view with a status bar and transition buttons, a menu, and a yearly numbering sequence.
Honest about the edges
What this does not do, so nothing surprises you.
- This module ships a group-gated workflow, not multi-step approval chains. Transitions are restricted by user group; it does not configure the platform's N-step approval, delegation, or escalation engine out of the box, though the platform supports wiring that in.
- The generation service runs on demand or when you call it; this module does not install a scheduled job to create overtime automatically on a timer. Add a cron or call the service from your own flow if you want unattended generation.
- Overtime is recorded and compensated as data (hours times multiplier, paid or time off in lieu). The module does not post payslip lines, create leave allocations, or write journal entries; integrate those in your payroll or leave configuration.
- Auto-detection reads the attendance day projection from the platform attendance module. It does not itself capture clock-in and clock-out; it depends on attendance data already being produced.
- Multiplier and compensation are per entry. There is no built-in rate table that selects multipliers automatically by day type, threshold, or award; set the value per entry or drive it from your own logic.
odoo overtime, odoo community overtime, overtime approval workflow, overtime from attendance, time off in lieu odoo, odoo hr overtime module, overtime multiplier odoo, paid overtime odoo, odoo 19 overtime, hr attendance overtime, overtime audit trail, multi company overtime odoo, employee overtime tracking, overtime compensation odoo
Need this fitted to the way you work?
ERP Heritage delivers end to end Odoo work: Odoo Implementation, Customization and Development, Integration, Migration, Consultation, Support and Training. We help teams put this module into production, shape it to their process, and keep it running.
We work with businesses across Australia (Melbourne, Sydney, Brisbane, Perth, Adelaide, Canberra) and the Middle East (Dubai, Abu Dhabi, Riyadh, Jeddah, Doha, Kuwait City, Muscat). Start a conversation at erpheritage.com.au or email info@erpheritage.com.au.
Languages
Available in 19 languages
The interface ships translated out of the box. Switch language in Odoo and the fields, menus, and messages follow.
Please log in to comment on this module