Learn – How to create a Tree View in Odoo 8 with Example

Greetings Everyone,

In this blog-post, you will learn how to create a Tree View in an Odoo 8 module.

What is Tree View in Odoo?

  • Tree View also known as List View shows multiple records in the form of a list (rows and columns).
  • Each row represents a record of the database table.
  • Tree View is used to show important data, i.e only some important columns of the model/table.
  • You can do various operations on Tree view that is sorting, filter and group by.

 

Example of a Tree View :-

Earlier in my previous blog-post, I had created a Model to collect student’s information. Then I had created its From View. Now I will create a Tree View for the student model.

Code for creating a Tree View:

Steps for creating Tree View in Odoo:

  • All views are stored in the database, in the ir.model.view model. To add a view in a module, we declare an <record> element describing the view in an XML file that will be loaded into the database when the module is installed.
  • The root element of a Tree View is <tree>
  • Now inside tree tag define all the important fields that you want to add to the tree view.

SnapShot of Eclipse IDE:-

tree view odoo module
Tree view odoo module – Click to enlarge
tree view odoo module
tree view odoo module – Click to enlarge

Hope you learnt how to create a Tree View in Odoo module, your reviews/comments/suggestions/doubts are most welcomed, please comment in the section below, and subscribe to the newsletter to receive timely future updates of this blog.

Further, Learn how to create an Action and its Menuitem in Odoo 8.

Thank You

Myself, Burhan Vakharia, am an Odoo developer, CS Lover living in Gandhinagar, Gujarat, India. I have a degree in Computer Science and Engineering from Babaria Institute of Technology. I am currently working as Odoo Developer. Apart from Odoo Framework, I have worked on C# .Net and Android Platforms. You can contact me via my social profiles shown below.

Post Author: Burhan Vakharia

Myself, Burhan Vakharia, am an Odoo developer, CS Lover living in Gandhinagar, Gujarat, India. I have a degree in Computer Science and Engineering from Babaria Institute of Technology. I am currently working as Odoo Developer. Apart from Odoo Framework, I have worked on C# .Net and Android Platforms. You can contact me via my social profiles shown below.

3 thoughts on “Learn – How to create a Tree View in Odoo 8 with Example

    RobertKT

    (April 7, 2016 - 9:06 am)

    I completely understood the concept. Nice post. Thank You.

    sehrish

    (May 14, 2018 - 9:33 am)

    It is really a great and useful piece of info. I’m glad that you shared this helpful info with us. Please keep us informed like this. Thank you for sharing.

Leave a Reply

Your email address will not be published. Required fields are marked *