LEFT | RIGHT |
(no file at all) | |
1 .. _topics-views: | 1 .. _topics-views: |
2 | 2 |
3 ===== | 3 ===== |
4 Views | 4 Views |
5 ===== | 5 ===== |
6 | 6 |
7 The views are used to display records of an object to the user. | 7 The views are used to display records of an :class:`ModelView |
8 | 8 <trytond.model.ModelView>` to the user. |
9 In Tryton, objects can have several views. An `action` opens a window and | 9 |
10 defines which view to show. | 10 In Tryton, :class:`ModelView <trytond.model.ModelView>` can have several views. |
11 | 11 An `action` opens a window and defines which view to show. |
12 The views are built from XML that is stored in the databases with the object | 12 |
13 ir.ui.view. | 13 The views are built from XML that is stored in the `view` directory of the |
14 | 14 module or in the databases thanks to the model ir.ui.view. |
15 So generally, they are defined in xml files with this kind of xml: | 15 |
| 16 So generally, they are defined in xml files with this kind of xml where name is |
| 17 the name of the XML file in the `view` directory: |
16 | 18 |
17 .. highlight:: xml | 19 .. highlight:: xml |
18 | 20 |
19 :: | 21 :: |
20 | 22 |
21 <record model="ir.ui.view" id="view_id"> | 23 <record model="ir.ui.view" id="view_id"> |
22 <field name="model">model name</field> | 24 <field name="model">model name</field> |
23 <field name="type">type name</field> | 25 <field name="type">type name</field> |
24 <!--field name="inherit" ref="inherit_view_id"/--> | 26 <!--field name="inherit" ref="inherit_view_id"/--> |
25 <!--field name="field_childs">field name</field--> | 27 <!--field name="field_childs">field name</field--> |
26 <field name="arch" type="xml"> | 28 <field name="name">view_name</field> |
27 <![CDATA[ | |
28 View XML ... | |
29 ]]> | |
30 </field> | |
31 </record> | 29 </record> |
32 | 30 |
33 | 31 |
34 There is three types of views: | 32 There is three types of views: |
35 | 33 |
36 * Form | 34 * Form |
37 | 35 |
38 * Tree | 36 * Tree |
39 | 37 |
40 * Graph | 38 * Graph |
(...skipping 606 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
647 ^^^^^ | 645 ^^^^^ |
648 | 646 |
649 Same as in ``Form`` view. | 647 Same as in ``Form`` view. |
650 | 648 |
651 action | 649 action |
652 ^^^^^^ | 650 ^^^^^^ |
653 | 651 |
654 * ``name``: The id of the action window. | 652 * ``name``: The id of the action window. |
655 | 653 |
656 * ``colspan``: see in common-attributes-colspan_. | 654 * ``colspan``: see in common-attributes-colspan_. |
LEFT | RIGHT |