Overtime & Official Business
Overtime (OT) and Official Business (OB) are two separate concepts that share similar approval mechanics. OT is extra work-hours beyond the regular schedule; OB is pre-approved time away from the office for legitimate work reasons (client visits, offsite meetings, training).
HR Administrators, approvers (via the backend or mobile app), payroll officers.
Data model
| Model | Purpose |
|---|---|
hr.filed.overtime | Per-employee OT filing — start/end datetimes, reason, approval state. |
hr.batch.ot.requests | Batch OT — one approver approves many employees in one transaction. |
hr.ob | Official Business master (type/category). |
hr.employee.ob | Per-employee OB filing. |
OT and Batch OT live in a sibling module (hr17_tk) alongside hr17 — they are part of the same ONe-HR product suite.
Overtime filing
Most OT is filed from the mobile app. The backend view is used for:
- HR admins filing on an employee's behalf (e.g. after an undocumented OT).
- Approvers reviewing / modifying pending records.
- Audit and reporting.
Lunch break deduction — the key rule
ONe-HR automatically deducts 1 hour for lunch when OT hours overlap with the scheduled lunch break (typically 12:00–13:00). The logic lives in the OT approval wizard:
- On approval, the system computes OT duration.
- If the OT window crosses the lunch break (
hour_fromtohour_from + 1inresource.calendarterms), a wizard opens. - The wizard shows the employee's schedule, the OT window, the lunch interval, and the adjusted duration.
- The approver can accept the default (deduct) or uncheck to skip.
- The resulting
lunch_break_deductedflag is stored on the OT record for DTR and payroll computation.
Without this rule, an employee could log 8h–19h as 11h of OT — when in practice they took lunch like everyone else. The 1-hour deduction is the conservative default; approvers with evidence of continuous work (e.g. client meeting through lunch) can uncheck it per case.
Batch OT approvals
For end-of-month catch-up approvals, the Batch OT Approval wizard groups pending OTs from the same period. The wizard:
- Shows every employee with a pending OT.
- Highlights which have lunch-overlap (pre-selected for deduction, colored green).
- Lets the approver toggle deduction per employee.
- Approves them all in a single commit.
The approval decision (deduction or no deduction) is posted to the batch chatter for audit.
Official Business (OB)
OB has two faces in ONe-HR:
The OB category master (hr.ob)
A reference model — typical categories: "Client Visit", "Supplier Meeting", "Training", "Field Work". Administered via HR ▸ Maintenance ▸ Official Business Types.
The employee OB filing (hr.employee.ob)
One row per OB request. Fields:
| Field | Purpose |
|---|---|
| Name | Description of the OB activity. |
| Date | OB date. |
| Description | Details — location, counterparts, deliverables. |
| Amount | Optional — for OBs that carry a per-diem or reimbursement. |
| Status | active / revoked / discontinued. |
The mobile app OB flow (docs) writes directly to this model. Backend admins see the same record.
The resource calendar
The lunch-break logic depends on resource.calendar attendance records with day_period='morning'. The module extends resource.calendar (models/resource_calendar.py) to auto-name new calendars after the company and to seed a default 7:30–16:30 schedule for Mon–Sat if none exists.
Each BU typically has one base calendar plus per-employee calendars for shifts that differ from the default. Edit under Settings ▸ Technical ▸ Working Schedules (requires developer mode).
Approver chain for OT/OB
OT and OB approvers are set on the employee form (ot_approver_ids, ob_approver_ids Many2many). See Organization for the assignment UI. Every approver in the chain receives a notification; any one of them can approve (not all-must-approve).