Files
hr-tools/hr_holidays_timeoff_analysis
..

hr_holidays_timeoff_analysis

Breaks down validated time-off requests into individual day records and provides a pivot table for analyzing leave consumption by employee, leave type, and period.

Features

Time-off day model (hr.leave.timeoff.day)

One record per actual day of absence, with the following fields:

  • Date: the specific day.
  • Employee: the employee on leave.
  • Leave request: link to the original hr.leave record.
  • Leave type: related field from the leave request (e.g. Paid leave, Sick leave).
  • Duration by day: the fraction of the day taken off (1.0 for a full day, 0.5 for a half day, or a proportional value for hourly leaves based on number_of_days_display).

Calendar resolution

The module determines the employee's working calendar using the following priority:

  1. Employee calendar planning (hr.employee.calendar): if the hr_employee_calendar_planning module is installed, the calendar matching the date range is used. This allows correct handling of employees who switch between full-time and part-time.
  2. Employee calendar (resource_calendar_id): the calendar set directly on the employee.
  3. Company calendar: fallback to the company's default calendar.

Only days where the employee is scheduled to work are recorded. Weekends and non-attendance days are skipped.

Public holiday handling

Public holidays are excluded from time-off day records. The module converts public holiday dates to the employee's timezone before comparison, ensuring correct results for holidays that span midnight UTC.

Scheduled action (cron)

A daily cron job (cron_manage_timeoff_days) performs two operations:

  1. Create: Iterates over all validated leaves and creates a hr.leave.timeoff.day record for each working day within the leave period (skipping weekends, non-attendance days, and public holidays).
  2. Delete: Removes records linked to leaves that are no longer validated (draft, refused) or have been cancelled (active=False). Also cleans up orphan records not linked to any leave.

Views

  • List view: Editable list showing date, employee, leave request, leave type, and duration.
  • Pivot view: Leave days broken down by month (columns) and employee + leave type (rows) — the primary analysis tool.
  • Search view: Date filter defaulting to the current year.

The menu entry is located under Time Off > Reporting > Timeoff Days, accessible to Time Off managers.

Access rights

Read-only access is granted to the Time Off manager group (hr_holidays.group_hr_holidays_manager).

Tests

The module includes tests covering:

  • Multi-day leaves spanning two months.
  • Half-day leaves (duration = 0.5).
  • Hourly leaves compared against the employee's calendar.
  • Part-time employee calendars (4-day week).
  • Public holidays falling within a leave period.
  • Unvalidated and deleted leaves (cleanup verification).
  • Cancelled leaves (active=False).
  • Employee calendar planning integration (switching calendars mid-period).

Installation

This module depends on:

  • base (Odoo core)
  • hr_holidays (Odoo core)

Optional: install hr_employee_calendar_planning to enable per-period calendar resolution.

Use the standard Odoo module installation procedure to install hr_holidays_timeoff_analysis.

Known issues / Roadmap

None yet.

Bug Tracker

Bugs are tracked on our issues website. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us smashing it by providing a detailed and welcomed feedback.

Credits

Contributors

Funders

The development of this module has been financially supported by:

Maintainer

This module is maintained by Elabore.