Nest your records under their parents, in one list.
A new view type for any model that points to itself — categories, contacts, departments, locations. Rows open like folders, and everything a list can do, from inline editing to sums, still works.
The top level is paged like any list. The children of a row are read in one call when you open it.
Every match stays at its own depth, under its parents, so you see where it sits and not only that it exists.
Drop a row on another to move it there. A record can never end up inside one of its own children.
A list that knows its hierarchy
Everything else is the list view you already know: columns, widgets, sums, buttons, decorations and inline editing.
Each record sits indented under its parent, with a chevron to open it. The rows you opened stay open the next time.
Matches stay in the tree. The parents that lead to them are shown greyed out and opened for you.
The + on a row starts a record right under it, with the parent filled in, edited inline or in the form.
Drop a row on another to move it beneath, or on its upper or lower edge to make the two siblings.
Mark a numeric column as a rollup and every parent row shows the total of its whole subtree.
Right opens a row, Left closes it or jumps to its parent, and each row tells assistive technology its level.
Find a record without losing its place
A flat search result tells you what matched and nothing about where it lives. The tree list keeps every match at its own depth and brings the parents along, greyed out and in italics, opened down to the match. Clear the search and the tree is back as you left it.
Add it where it belongs
Hover a row and click + to start a record directly beneath it, with the parent already set. On an editable tree you type into the row and save; otherwise the form opens, prefilled. Moving a record later is a drag of its handle onto the new parent.
A record can not be dropped onto one of its own descendants, so a drag never cuts a branch off the tree.
Put it on any hierarchy
The module brings the view type, not the views. A <treelist> goes next to the list and form an action already has, on whichever models your teams browse as a hierarchy.
The tree follows parent_id, or any many2one to the same model named in parent_field.
Add rollup="1" to a numeric field and parents show the total of their subtree, in the row and in the footer.
Group the view by a field and every group shows its records as a tree, with its own pager for the top-level rows.
Help and support
What you get for free, and what has to be paid work.
Issues and merge requests are welcome on the public repository. They are read — but no response time is promised.
A tree list set up on your own models, or a fix on a deadline, is paid work — quoted up front. Write to sale@mukit.at.
LGPL-3. Use it, change it, ship it inside your own work — no licence key, no database count.
Want more?
MuK IT — Austrian Odoo partner, ViennaModules written for your process, on your Odoo version.
Odoo joined up with the systems you already run.
Hosting, deployment and upgrades you do not have to watch.
Your team taught the parts of Odoo they actually use.
An agreement, so an answer does not depend on who is free.
Documentation
The full text is on the Documentation tab, and in doc/ inside the download.Odoo.sh or on-premise, Community or Enterprise.
A treelist view on the action, and the attributes it takes.
Depends on muk_web_group alone, nothing external.
Opening rows, searching, adding children, dragging and the keyboard.
Open rows are kept in the browser, so an upgrade has nothing to migrate.
MuK IT GmbH, Vienna. Author and maintainer.
Which of your records have parents?
Tell us which hierarchies your teams still scroll through as flat lists, and we will tell you where a tree list saves them the search. MuK IT — Austrian Odoo partner, Vienna.
| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Odoo Apps Dependencies |
Discuss (mail)
|
| Community Apps Dependencies | Show |
| Lines of code | 2205 |
| Technical Name |
muk_web_tree |
| License | LGPL-3 |
| Website | http://www.mukit.at |
MuK Tree List
The module adds the treelist view type: a list view whose rows nest under their parent record and open and close like the folders of a file explorer. It works on any model with a many2one to itself, such as product categories, contacts, departments or locations, and keeps what a list view offers: inline editing, optional columns, sums, widgets and decorations.
Installation
To install this module, you need to:
Download the module and add it to your Odoo addons folder. Afterward, log on to your Odoo server and go to the Apps menu. Trigger the debug mode and update the list by clicking on the "Update Apps List" link. Now install the module by clicking on the install button.
Upgrade
To upgrade this module, you need to:
Download the module and add it to your Odoo addons folder. Restart the server and log on to your Odoo server. Select the Apps menu and upgrade the module by clicking on the upgrade button.
Configuration
No configuration is required for users. A developer adds a treelist to an action by writing a view with the treelist tag and adding treelist to the action's view mode. The view takes the same children and attributes as a list, plus the ones below.
<treelist parent_field="parent_id" editable="bottom" draggable="1"> <field name="name"/> <field name="budget" sum="Total" rollup="1"/> </treelist>
- parent_field - the many2one to the same model, parent_id by default.
- expand="1" - open every row when the view is first loaded.
- draggable="1" - move a record under another one by drag and drop.
- widget="handle" on a sequence field - drag a row above or below one of its siblings to change their order, as in a list.
- rollup="1" on a numeric field without a widget - show the total of the subtree on each parent row and in the footer.
- A <column> as the first column - its fields sit side by side after the chevron, such as an icon before the name. Give it a width such as [240]: a list sizes a column group by its first field.
Usage
- Only the top-level records are paged. Click the chevron of a row to load and show its children; the open rows are remembered per action in the browser. A row with more children than the page size gets its own pager, like a group of a list, to page through them.
- Right opens the focused row, Left closes it or jumps to its parent.
- A search shows every match in place, below all of its parents up to the root. The parents that do not match are shown greyed out and opened automatically; they cannot be selected and are left out of the sums. A record whose parent is archived, not readable or outside the domain of the action is shown as a root instead.
- Click + on a row to add a child directly under it, with the parent already filled in; Enter saves it and starts the next sibling. Without editable the form opens instead.
- Drag a row by its handle onto another row to move it under that row, or onto the upper or lower edge of a row to make it a sibling. The future parent is highlighted while dragging. A record cannot be moved under one of its own children.
- Grouped, each group shows its records as a tree and pages its top-level rows. A record whose parent falls into another group is a root of its own group. A search inside groups shows only the matches, without greyed-out parents.
- A search panel that the list view shows is shown next to the tree as well.
- An Excel export lists every parent before its children, indents the first column by level and outlines the rows, so they open and close in Excel too. During a search, the greyed-out parents are exported as header rows above their matches, as on the screen.
- Expand All and Collapse All in the cog menu open or close every row, or the groups when the view is grouped.
Credits
Contributors
- Mathias Markl <mathias.markl@mukit.at>
Author & Maintainer
This module is maintained by the MuK IT GmbH.
MuK IT is an Austrian company specialized in customizing and extending Odoo. We develop custom solutions for your individual needs to help you focus on your strength and expertise to grow your business.
If you want to get in touch please contact us via mail (sale@mukit.at) or visit our website (https://mukit.at).
Please log in to comment on this module
very good
There are no comments yet!