Hierarchy Tree Selector (Parent/Child Many2one)
by Cerevantix Technologies https://cerevantix.com$ 110.60
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.
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.
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.
This app speaks your language.
Tell us the language your team works in and we translate this module for you, free of charge — so everyone works in the language they know best.
Request my free translation →No hidden fees. No subscription.
Everything the flat dropdown couldn't do
Every capability below is implemented in the module.
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.
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.
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.
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.
Full Keyboard Navigation
Arrow keys move, expand, and collapse; Enter selects; Escape closes — high-volume data entry never needs the mouse.
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.
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.
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.
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.
How it works
Enable the widget
Add widget="hierarchy_m2o" to any self-referential Many2one field in a view and point options at its parent field.
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.
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.
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.
See it in action
Every screen below is a live, install-and-go feature of this module.
Cost Center list view with complete name path, code, parent, and a live entry count per center.
Cost Center form — the Parent field uses the hierarchy_m2o widget instead of a flat dropdown, with an inline Children list below it.
The hierarchy_m2o dropdown open on a Cost Center: expandable branches, in-tree search, and depth-indented rows.
Cost Entry list showing the linked cost center, product category, stock location, and amount for every entry.
Cost Entry form with three independent hierarchy_m2o selectors (cost center, product category, stock location) plus an inline read-only hierarchy_m2o_chart of the selected cost center.
The hierarchy_m2o dropdown open on the Cost Entry form, filtering the tree as you type.
Product Category's native Parent Category field, now rendered with the hierarchy_m2o tree widget — enabled out of the box.
Stock Location's native Parent Location field with the hierarchy_m2o tree widget pre-wired for multi-warehouse structures.
Frequently asked
Does this replace Odoo's standard Many2one field?
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.
Which Odoo hierarchies does it work with out of the box?
Product Categories and Stock Locations are pre-wired the moment you install the module. It also ships two demo models (Cost Centers and Cost Entries) so you can see it in action immediately, and it works on any other self-referential Many2one you point it at via a single view option.
How does it handle large or deep hierarchies?
The tree loads its data once and renders only expanded branches, so hierarchies with hundreds of nodes or many levels of depth stay responsive; collapsed branches are never painted to the page.
Can I use it without a mouse?
Yes. Arrow keys expand, collapse, and move between nodes, typing filters the tree via search, and Enter selects the focused node — the whole flow works from the keyboard.
Get in Touch
Have questions or need customization? Every purchase includes 30 days of free support — we are here to help.
Visit Our Website
www.cerevantix.comExplore our apps, services, and portfolio.
Empowering growth through technology.
Expandable, searchable, keyboard-navigable tree selector for any self-referential Many2one field — pre-wired on Product Categories and Stock Locations.
| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Odoo Apps Dependencies |
•
Inventory (stock)
• Discuss (mail) |
| Lines of code | 872 |
| Technical Name |
cerevantix_many2one_hierarchy_parent_child_m2o |
| License | OPL-1 |
| Website | https://cerevantix.com |
Odoo Proprietary License v1.0 This software and associated files (the "Software") may only be used (executed, modified, executed after modifications) if you have purchased a valid license from the authors, typically via Odoo Apps, or if you have received a written agreement from the authors of the Software (see the COPYRIGHT file). You may develop Odoo modules that use the Software as a library (typically by depending on it, importing it and using its resources), but without copying any source code or material from the Software. You may distribute those modules under the license of your choice, provided that this license is compatible with the terms of the Odoo Proprietary License (For example: LGPL, MIT, or proprietary licenses similar to this one). It is forbidden to publish, distribute, sublicense, or sell copies of the Software or modified copies of the Software. The above copyright notice and this permission notice must be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Please log in to comment on this module