hr_leave_stats
Two lists on a time off request: what this employee has already taken this year, and who else in their department is away over the same dates.
August 27, 2026Updated August 31, 20264 min read
| Technical name | hr_leave_stats |
|---|---|
| Views | form (view widget, <widget> element) |
| Module | hr_holidays, the Time Off app |
| Used in core | The time off request form in hr_holidays |
| Versions | Odoo 20.0, Odoo 19.0, Odoo 18.0, Odoo 17.0, Odoo 16.0 |
| No-code setup | No. It is set in view XML and depends on module-specific data |
| Alternatives | hr_holidays_radio_image, web_ribbon, remaining_days |
What the leave stats panel does
What this means for your team
Supported options in Odoo 19
| Option | Type | What it does |
|---|---|---|
employee_id | requested field dependency | Drives the employee panel, and is excluded from the department panel. |
date_from | requested field dependency | Its calendar year bounds the employee query; its value bounds the department overlap test. |
date_to | requested field dependency | Bounds the department overlap test alongside the start date. |
department_id | requested field dependency | Drives the department panel. Its display name path is trimmed to the last segment. |
Only validated leave counts. Both queries filter on the validated state, so pending requests appear in neither list. That is deliberate: a pending request is not yet a fact about coverage.
Working examples
Two queries, two windows
Version compatibility
| Version | Status | Notes |
|---|---|---|
| Odoo 20.0 | Partial / changed | Not released. Substantially rewritten around newer conventions. |
| Odoo 19.0 | Verified | Verified against the shipped source. |
| Odoo 18.0 | Verified | Same two panels and query windows. |
| Odoo 17.0 | Verified | Same two panels with older component conventions. |
| Odoo 16.0 | Verified | Same two panels with older component conventions. |
Upgrade note. Present since Odoo 16 in this form. The queries and the two-panel structure have been stable across those versions, so an upgrade needs no attention here.
What is changing in Odoo 20
Common problems and fixes
| Symptom | Cause and fix |
|---|---|
| The department panel is empty | No employee or no department is set, or nobody else in that department overlaps. Check both fields are filled; an empty result is often correct. |
| A pending request does not appear | Both queries filter on the validated state. Expected. Validate it first if it should count. |
| The employee panel shows leave outside the request | That panel covers the whole calendar year of the request's start date. Expected; it answers a different question from the department panel. |
| The requesting employee appears as a conflict | They should not; the department query excludes them. Check the employee field is actually set on the record. |
| The department name looks truncated | Only the last segment of the hierarchy path is displayed. Expected. The full path is available on the department record. |
| Nothing reloads when I change dates | The observer compares the previous and new values before requerying. Check the date actually changed; identical values do not requery. |
Leave stats panel vs the alternatives
| Widget | Best for | Key difference |
|---|---|---|
hr_leave_stats | Giving an approver the year pattern and the coverage picture on the request itself | Two queries with different date windows, both limited to validated leave |
hr_holidays_radio_image | Choosing a leave type visually | A picker rather than a context panel |
| web_ribbon | Marking a request's status | A label rather than context |
| remaining_days | Showing how soon a date falls | A single value rather than two lists |
Frequently asked questions
Why do the two panels use different date ranges?+
Why do not pending requests show?+
Does it save the record to refresh?+
Why is the department name shortened?+
Which versions have it?+
Time off approvals that do not create coverage gaps
Accrual rules, approval chains and team coverage all interact, and getting them wrong is only visible when someone is missing. We implement Odoo Time Off end to end, on versions 16 through 19.
Book a free consultation