~openerp-community/openobject-doc/ksa-openobject-doc-6.0

« back to all changes in this revision

Viewing changes to i18n/ru/source/developer/2_6_views_events/views/graph_view.rst

  • Committer: Don Kirkby
  • Date: 2011-02-21 20:46:11 UTC
  • mfrom: (433.1.53 openobject-doc)
  • Revision ID: donkirkby+launpd@gmail.com-20110221204611-1ykt6dmg4k3gh5dh
[MERGE] revisions 477 to 486 from the 5.0 branch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
.. i18n: Graph views
 
3
.. i18n: --------------
 
4
..
 
5
 
 
6
Graph views
 
7
--------------
 
8
 
 
9
.. i18n: 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 seperate menu item):
 
10
..
 
11
 
 
12
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 seperate menu item):
 
13
 
 
14
.. i18n: .. code-block:: xml
 
15
.. i18n: 
 
16
.. i18n:         <field name="view_type">form</field>
 
17
.. i18n:         <field name="view_mode">tree,graph</field>
 
18
..
 
19
 
 
20
.. code-block:: xml
 
21
 
 
22
         <field name="view_type">form</field>
 
23
         <field name="view_mode">tree,graph</field>
 
24
 
 
25
.. i18n: view_type::
 
26
.. i18n: 
 
27
.. i18n:         tree = (tree with shortcuts at the left), form = (switchaable view form/list) 
 
28
..
 
29
 
 
30
view_type::
 
31
 
 
32
        tree = (tree with shortcuts at the left), form = (switchaable view form/list) 
 
33
 
 
34
.. i18n: view_mode::
 
35
.. i18n: 
 
36
.. i18n:         tree,graph : sequences of the views when switching 
 
37
..
 
38
 
 
39
view_mode::
 
40
 
 
41
        tree,graph : sequences of the views when switching 
 
42
 
 
43
.. i18n: Then, the user will be able to switch from one view to the other. Unlike forms and trees, OpenERP is not able to automatically create a view on demand for the graph type. So, you must define a view for this graph:
 
44
..
 
45
 
 
46
Then, the user will be able to switch from one view to the other. Unlike forms and trees, OpenERP is not able to automatically create a view on demand for the graph type. So, you must define a view for this graph:
 
47
 
 
48
.. i18n: .. code-block:: xml
 
49
.. i18n: 
 
50
.. i18n:        <record model="ir.ui.view" id="view_order_line_graph">
 
51
.. i18n:           <field name="name">sale.order.line.graph</field>
 
52
.. i18n:           <field name="model">sale.order.line</field>
 
53
.. i18n:           <field name="type">graph</field>
 
54
.. i18n:           <field name="arch" type="xml">
 
55
.. i18n:                 <graph string="Sales Order Lines">
 
56
.. i18n:                      <field name="product_id" group="True"/>
 
57
.. i18n:                      <field name="price_unit" operator="*"/>
 
58
.. i18n:                </graph>
 
59
.. i18n:            </field>
 
60
.. i18n:        </record>
 
61
..
 
62
 
 
63
.. code-block:: xml
 
64
 
 
65
        <record model="ir.ui.view" id="view_order_line_graph">
 
66
           <field name="name">sale.order.line.graph</field>
 
67
           <field name="model">sale.order.line</field>
 
68
           <field name="type">graph</field>
 
69
           <field name="arch" type="xml">
 
70
                 <graph string="Sales Order Lines">
 
71
                      <field name="product_id" group="True"/>
 
72
                      <field name="price_unit" operator="*"/>
 
73
                </graph>
 
74
            </field>
 
75
        </record>
 
76
 
 
77
.. i18n: The graph view
 
78
..
 
79
 
 
80
The graph view
 
81
 
 
82
.. i18n: A view of type graph is just a list of fields for the graph.
 
83
..
 
84
 
 
85
A view of type graph is just a list of fields for the graph.
 
86
 
 
87
.. i18n: Graph tag
 
88
.. i18n: ++++++++++
 
89
..
 
90
 
 
91
Graph tag
 
92
++++++++++
 
93
 
 
94
.. i18n: The default type of the graph is a pie chart - to change it to a barchart change **<graph string="Sales Order Lines">** to **<graph string="Sales Order Lines" type="bar">** You also may change the orientation.
 
95
..
 
96
 
 
97
The default type of the graph is a pie chart - to change it to a barchart change **<graph string="Sales Order Lines">** to **<graph string="Sales Order Lines" type="bar">** You also may change the orientation.
 
98
 
 
99
.. i18n: :Example : 
 
100
..
 
101
 
 
102
:Example : 
 
103
 
 
104
.. i18n: .. code-block:: xml
 
105
.. i18n: 
 
106
.. i18n:        <graph string="Sales Order Lines" orientation="horizontal" type="bar">
 
107
..
 
108
 
 
109
.. code-block:: xml
 
110
 
 
111
        <graph string="Sales Order Lines" orientation="horizontal" type="bar">
 
112
 
 
113
.. i18n: Field tag
 
114
.. i18n: +++++++++
 
115
..
 
116
 
 
117
Field tag
 
118
+++++++++
 
119
 
 
120
.. i18n: The first field is the X axis. The second one is the Y axis and the optional third one is the Z axis for 3 dimensional graphs. You can apply a few attributes to each field/axis:
 
121
..
 
122
 
 
123
The first field is the X axis. The second one is the Y axis and the optional third one is the Z axis for 3 dimensional graphs. You can apply a few attributes to each field/axis:
 
124
 
 
125
.. i18n:     * **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
 
126
.. i18n:     * **operator**: the operator to apply is another field is grouped. By default it's '+'. Allowed values are:
 
127
..
 
128
 
 
129
    * **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
 
130
    * **operator**: the operator to apply is another field is grouped. By default it's '+'. Allowed values are:
 
131
 
 
132
.. i18n:           + +: addition
 
133
.. i18n:           + \*: multiply
 
134
.. i18n:           + \**: exponent
 
135
.. i18n:           + min: minimum of the list
 
136
.. i18n:           + max: maximum of the list 
 
137
..
 
138
 
 
139
          + +: addition
 
140
          + \*: multiply
 
141
          + \**: exponent
 
142
          + min: minimum of the list
 
143
          + max: maximum of the list 
 
144
 
 
145
.. i18n: :Defining real statistics on objects:
 
146
..
 
147
 
 
148
:Defining real statistics on objects:
 
149
 
 
150
.. i18n: The easiest method to compute real statistics on objects is:
 
151
..
 
152
 
 
153
The easiest method to compute real statistics on objects is:
 
154
 
 
155
.. i18n:    1. Define a statistic object wich is a postgresql view
 
156
.. i18n:    2. Create a tree view and a graph view on this object 
 
157
..
 
158
 
 
159
   1. Define a statistic object wich is a postgresql view
 
160
   2. Create a tree view and a graph view on this object 
 
161
 
 
162
.. i18n: You can get en example in all modules of the form: report\_.... Example: report_crm. 
 
163
..
 
164
 
 
165
You can get en example in all modules of the form: report\_.... Example: report_crm.