Graph and pivot views

Graph views provide a graphical view of the data, in the form of a chart. The current fields available in the To-do Tasks are not good candidates for a chart, so we will add one to use on such a view.

In the TodoTask class, at the todo_ui/models/todo_model.py file, add:

effort_estimate = fields.Integer('Effort Estimate') 

It also needs to be added to the To-do Task form, so that we can add values for it on the existing records, and are able to check this new view.

Now let's add the To-Do Tasks graph view:

<record id="view_graph_todo_task" model="ir.ui.view"> <field name="model">todo.task</field> <field name="arch" type="xml"> <graph type="bar"> <field name="stage_id" /> <field name="effort_estimate" type="measure" /> </graph> ...

Get Odoo 10 Development Essentials now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.