Turn flat Many2one lists into a living hierarchy tree

Replace Odoo's flat Many2one dropdown with an expandable, searchable, keyboard-navigable tree selector for product categories, stock locations, cost centers, and any other parent-child relation.

The problem

Deeply nested data — product categories, stock locations, charts of accounts, cost centers — collapses into one long alphabetical list in Odoo's native Many2one dropdown. Users lose all sense of where a record sits in the hierarchy, scroll through hundreds of similarly named entries, and regularly pick the wrong parent, corrupting downstream reports.

The solution

Hierarchy Tree Selector renders any self-referential Many2one as a true expandable tree with in-line search, full keyboard navigation, and an always-visible breadcrumb of the selected path. Point it at any hierarchical field with one view option and it works — no custom code, no per-field setup beyond a widget attribute.

Capabilities

Everything the flat dropdown couldn't do

Every capability below is implemented in the module.

01

Hierarchical Tree Dropdown

Any self-referential Many2one renders as an expandable tree instead of a flat autocomplete list, with a single widget="hierarchy_m2o" attribute.

02

Zero-Code Reuse On Any Field

Point the widget at any parent field via a view option and it works on that hierarchy — no Python, no per-field development.

03

Pre-Wired On Product Categories & Stock Locations

The tree selector is already enabled on Product Category and Stock Location parent fields the moment the module is installed.

04

In-Tree Search With Path Reveal

Type to filter the tree; matching nodes surface instantly with their full ancestor path expanded, so users jump straight to the right record.

05

Full Keyboard Navigation

Arrow keys move, expand, and collapse; Enter selects; Escape closes — high-volume data entry never needs the mouse.

06

Visual Depth Indicators & Breadcrumb

Indentation shows tree depth at a glance, and the selected value always displays its full ancestor breadcrumb — no more guessing which "Chairs" you picked.

07

Configurable Default Expansion Level

Admins choose whether a tree opens fully collapsed, fully expanded, or expanded to a given depth — a single view option keeps large trees manageable.

08

DOM-Lazy Rendering For Performance

Data loads once; only expanded branches are painted to the page, so trees with hundreds of nodes and many levels stay responsive.

09

Inline Read-Only Hierarchy Chart

The included hierarchy_m2o_chart variant shows a fully expanded, read-only tree that visualizes exactly where the selected node sits.

Workflow

How it works

1

Enable the widget

Add widget="hierarchy_m2o" to any self-referential Many2one field in a view and point options at its parent field.

2

Browse or search the tree

Click to open the dropdown, expand or collapse branches, or type to filter and jump straight to a matching node.

3

Select with keyboard or mouse

Arrow keys and Enter, or a click, pick the exact node; the breadcrumb confirms the full path before you move on.

4

See it work out of the box

Product Categories and Stock Locations already use the tree selector, and two demo models let you try every feature immediately.

Questions

Frequently asked

No sales fog. If your question isn't here, email us and we'll answer it the same way.

No data migration is required. It is a drop-in field widget: add widget="hierarchy_m2o" to any existing self-referential Many2one in a view and it renders as a tree instead of a flat list; the underlying field and data are untouched.

Get the app

Buy it on the Odoo App Store

Purchase, download and install directly from the official Odoo Apps Store — you'll always get the latest supported build.

Hierarchy Tree Selector (Parent/Child Many2one)

An expandable, searchable, keyboard-navigable tree selector for any self-referential Many2one field — pre-wired on product categories and stock locations, in place of one long alphabetical dropdown.

Buy on Odoo App Store