This is the documentation for older versions of Odoo (formerly OpenERP).

See the new Odoo user documentation.

See the new Odoo technical documentation.

Graph views

A graph is a new mode of view for all views of type form. If, for example, a sale order line must be visible as list or as graph, define it like this in the action that open this sale order line. Do not set the view mode as "tree,form,graph" or "form,graph" - it must be "graph,tree" to show the graph first or "tree,graph" to show the list first. (This view mode is extra to your "form,tree" view and should have a separate menu item):

<field name="view_type">form</field>
<field name="view_mode">tree,graph</field>


tree = (tree with shortcuts at the left), form = (switchable view form/list)


tree,graph : sequences of the views when switching


<record model="ir.ui.view" id="view_order_line_graph">
   <field name="name">sale.order.line.graph</field>
   <field name="model">sale.order.line</field>
   <field name="type">graph</field>
   <field name="arch" type="xml">
         <graph string="Sales Order Lines">
              <field name="product_id" group="True"/>
              <field name="price_unit" operator="*"/>

The graph view


Graph tag

graph的默认类型是圆形分格统计图表(pie chart),要将它转换成条形图(barchart),就需要将<graph string=”Sales Order Lines”> 转换成 <graph string=”Sales Order Lines” type=”bar”>,你也可以改变方向。

:例如 :

<graph string="Sales Order Lines" orientation="horizontal" type="bar">

Field tag


  • group: if set to true, the client will group all item of the same value for this field. For each other field, it will apply an operator

  • operator: the operator to apply is another field is grouped. By default it's '+'. Allowed values are:

    • +: addition

    • *: multiply

    • **: exponent

    • min: minimum of the list

    • max: maximum of the list

Defining real statistics on objects:


  1. 定义一个统计对象,它是PostgreSQL视图

  2. 在这个对象上创建一个tree view和graph view

You can get en example in all modules of the form: report_.... Example: report_crm.