Default expand the tree in the client

I have a form with some fields, and below that a list of children. This list of children is displayed as a tree. When I open a record (switch the view to form-mode), the tree is default fully collapsed to 1 level. But now I want the tree to be fully expanded when I open the form, so I don’t need to expand the children myself. The level of depth is max. 3.

It there an XML option which defines this?

I found tree_state and added it to the <tree tree_state="1">.....</tree>. It seems that this is user specific.
Hopefully there is also something which is working globally and just expand the tree.

No there is not option to always expand a tree because a tree can have an infinite number of level if it is recursive for example.
But you can extend the get method of ir.ui.view_tree_state to return an expanded state for your model.

Thanks! For me, adding the tree_state to the XML is the most easy solution and when clearly communicated with the users it should be enough for now. First let them work with it for some months if they still complain, we can extend the get method :smile:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.