Hello everyone. Now, we’ll have a quick look at how to define list (tree), graph and pivot views. List views are used when we work in list mode in order to visualize several resources at once. These views are simpler than the form views and have less options.
Here we have a model named Marks which has a Many2one fields called ‘student_id’ ‘course_id’ and four float fields ‘exam1’ ‘exam2’ ‘extrat’ and ‘average’.
The Mark model has associated a Tree view:
- ‘arch’ : a view is declared as a record of the model ir.ui.view, the arch field must thus be declared as type=”xml” to be parsed correctly.
- ‘tree’ : is the root element of list views
Here is an screenshot of implementation:
The graph views is used to visualize aggregations over a number of records or record groups. Pivot technically isn’t a graph type, it displays the aggregation as a pivot table.
Here is an example of graph view:
And pivot view:
- ‘graph’: is the root elemen of graph views.
- ‘pivot’: is the root element of pivot views.
- ‘row’ : groups by the specified field. For pivot tables, each group gets its own row.
- ‘col’ : only used by pivot tables, creates column-wise groups.
And this windows action with three different values for view_mode:
Here is an screenshot of implementation of graph and pivot:
What am I missing here? Let me know in the comments and I’ll add it in 😉