Odoo 16 Development Book

Dashboard view

Dashboard view is used to get a good understanding of the various business KPIs. It will provide us a good overview of the records we can only get through this facility in the Odoo enterprise version. If we want to set up a dashboard view in your module, don’t forget to add the ‘web dashboard’ in the dependency in the manifest file. Let us take an example,

<record id="view_helpdesk_dashboard" model="ir.ui.view">
                                        <field name="name">Hepldesk dashbaord</field>
                                        <field name="model">helpdesk.ticket</field>
                                        <field name="arch" type="xml">
                                            <dashboard>
                                                <view ref="helpdesk.helpdesk_ticket_view_graph_analysis"
                                                         type="graph"/>
                                                <group>
                                                  <aggregate name="all_ticket"
                                                      string="Total Ticket"
                                                      group_operator="count"
                                                      field="id" measure="__count__"/>
                                                       <aggregate name="progress_tikets"
                                                                  string="In Progress Ticket" domain="[('stage_id.name', 'ilike',
                                                                  'In Progress')]"
                                                                  group_operator="count"
                                                                  field="id" measure="__count__"/>
                                                       <aggregate name="done_ticket"
                                                                  string="Done Ticket"
                                                                  domain="[('stage_id.name', 'ilike',
                                                                  'Done')]"
                                                                  group_operator="count" field="id"
                                                                  measure="__count__"/>
                                                       <formula name="average"
                                                                string="Overall Progress"
                                                                value="record.done_ticket / record.all_ticket"
                                                                widget="percentage"/>
                                                </group>
                                                <view ref="helpdesk.helpdesk_ticket_view_pivot_analysis"
                                                         type="pivot"/>
                                            </dashboard>
                                        </field>
                                    </record>

Now we can add the menu and action for this view.

<record id="act_window_dashboard" model="ir.actions.act_window">
                                        <field name="name">Dashboard of tickets</field>
                                        <field name="type">ir.actions.act_window</field>
                                        <field name="res_model">helpdesk.ticket</field>
                                        <field name="view_mode">dashboard</field>
                                    </record>
                                    <menuitem id="dashoard_ticket_menu"
                                        name="Dashboard"
                                        parent="helpdesk.helpdesk_ticket_report_menu_main"
                                        action="act_window_dashboard"
                                        sequence="28"/>

Here we can see that the dashboard view can include different types of graphical representation.

To specify these views, we will give these views XML reference in the tag’s ref attribute.

location

Calicut

Cybrosys Technologies Pvt. Ltd.
Neospace, Kinfra Techno Park
Kakkancherry, Calicut
Kerala, India - 673635

location

London

Cybrosys Limited
Alpha House,
100 Borough High Street, London,
SE1 1LB, United Kingdom

location

Kochi

Cybrosys Technologies Pvt. Ltd.
1st Floor, Thapasya Building,
Infopark, Kakkanad,
Kochi, India - 682030.

location

Bangalore

Cybrosys Techno Solutions
The Estate, 8th Floor,
Dickenson Road,
Bangalore, India - 560042

Send Us A Message