Skip to main content
iVentureTeam

hr_department_chart

The department's place in the org: parents above, children below, each clickable to open the employees inside it.

Siddharth JambukiyaSiddharth JambukiyaOdoo Techno-Functional Consultant
August 27, 2026Updated September 7, 20264 min read
Technical namehr_department_chart
Viewsform (view widget, <widget> element)
Modulehr, the Employees app
Used in coreThe department form in hr
VersionsOdoo 20.0, Odoo 19.0, Odoo 18.0, Odoo 17.0
No-code setupNo. It is set in view XML and depends on module-specific data
Alternativesmany2one_avatar_employee, hr_leave_stats, button_new_contract

What the department chart does

A department record on its own tells you very little: a name, a manager, a parent. What people actually want from it is the shape around it, which departments sit above and which below.

This widget draws that shape on the form. It asks the server for the hierarchy around this department and renders it, with each level clickable.

Clicking one does not navigate to that department: it opens that department's employees, which is usually the reason someone was looking at the chart.

What this means for your team

Department structure is one of those things everyone assumes is documented and usually is not. Putting the chart on the record makes the structure self-documenting, and makes a wrong parent obvious to whoever opens it.

Worth checking during implementation: whether your department tree models reporting or cost centers. Odoo uses it for both, and if those differ in your organization one of the two will be wrong on this chart.

Supported options in Odoo 19

The widget declares no options and takes the standard view widget props. The two server calls it makes are listed below. Read from the department chart source, Odoo 19.0.

OptionTypeWhat it does
get_department_hierarchyserver callReturns the whole structure around the department in one payload.
action_employee_from_departmentserver call per clickReturns an action showing that department's employees, which is then opened.
the props change hookrefetch triggerRefetches the hierarchy when the record changes without the component being recreated.

Both the shape and the click are server decisions. The hierarchy comes from one call, and each click asks for an action rather than constructing one, which keeps access rules and context in the server's hands.

Working examples

Placing it

<widget name="hr_department_chart"/>

No attributes. It reads the department from the record.

What builds the chart

hr.department.get_department_hierarchy(id)

One call, the whole structure.

What a click does

action_employee_from_department(id)
# then the returned action is opened

Employees, not the department record.

One call for the shape, one per click

Two lifecycle hooks fetch the hierarchy: one before the first render, and one whenever the props change. The second is easy to overlook and is what makes the chart correct when a user pages through departments in a list view without the component being destroyed between records.

The fetch itself is a single call taking the department identifier and returning the whole structure. Everything the chart draws, parents, children, counts, comes from that one payload, which keeps the render cheap and the browser ignorant of how the tree is computed.

The click handler is the other server round trip. Rather than constructing a window action with a domain, it asks the model for an action for that department and opens whatever comes back. That indirection is what allows the server to apply record rules, add context, or return a different view type without the widget changing.

Note that the click asks the model the widget is placed on rather than the department model directly, which matters if the widget is ever reused on a different form.

Version compatibility

VersionStatusNotes
Odoo 20.0Partial / changedNot released. Reworked around newer conventions.
Odoo 19.0VerifiedVerified against the shipped source.
Odoo 18.0VerifiedSame hierarchy call and click action.
Odoo 17.0VerifiedSame approach with older component conventions.
Odoo 16.0Not availableWidget does not exist.

Upgrade note. Present since Odoo 17. The single hierarchy call and the action-per-click pattern have been stable across those versions.

What is changing in Odoo 20

Odoo 20 is expected at Odoo Experience in Brussels, 24 to 26 September 2026. The development branch is unstable and this may still change; we re-verify this page after the release.

Reworked. The development branch updates the component to the newer state and lifecycle conventions. The hierarchy call and the click action are what to expect to survive.

Common problems and fixes

SymptomCause and fix
The chart is emptyThe department has no parent and no children. Expected for a flat structure.
The chart shows the previous departmentIt should not; a props change triggers a refetch. Reload the form if a customization interfered.
Clicking opens the wrong recordsThe action is requested from the model the widget sits on. Use it on the department form, which is what it expects.
Some departments are missingRecord rules filtered them out of the server's answer. Expected. Access rules apply to the hierarchy call.
Employee counts look wrongThey come from the server payload. Check the employees are assigned to the department.
The widget is missingThe employees module is not installed in that database. Install Employees.

Department chart vs the alternatives

WidgetBest forKey difference
hr_department_chartSeeing a department's place in the organization from its own formOne server call for the whole shape, and an action requested per click
many2one_avatar_employeeShowing a department managerA person on a record rather than the structure
hr_leave_statsLeave context on a requestAvailability rather than structure
button_new_contractStarting a contractAn action rather than a chart

The employee hierarchy view answers the same question at the person level rather than the department level, which is usually what a manager actually wants. This chart is the structural view.

Frequently asked questions

Where does the chart data come from?+
A single server call taking the department identifier and returning the whole structure. The browser never walks the tree itself.
What happens when I click a level?+
The widget asks the server for an action showing that department's employees and opens it, rather than navigating to the department record.
Why request an action instead of building one?+
So the server can apply record rules, add context or change the view type without the widget needing to know.
Does it update when I move between departments?+
Yes. A props change hook refetches the hierarchy, which matters when paging through a list without the component being recreated.
Which versions have it?+
Odoo 17 onwards. The development branch reworks it around newer conventions.

An org structure your HR system agrees with

Departments, managers and cost centers often diverge quietly, and payroll finds out first. We implement Odoo HR so the structure holds up, on versions 16 through 19.

Book a free consultation

How this page was produced

The single hierarchy server call, the refetch on props change, the per-click action request against the widget's own model and the absence of any browser-side tree walking were read from the department chart source on the Odoo 19.0 branch. Version coverage comes from comparing the file across the 17.0 and 18.0 branches and its absence on 16.0, plus a comparison against the public development branch. Spotted an error? Tell us and we will correct the page.