Merge branch 'master' of https://github.com/odoo/odoo
[odoo/odoo.git] / addons / account_test / account_test_view.xml
1 <?xml version="1.0"?>
2 <openerp>
3     <data>
4
5         <record model="ir.ui.view" id="account_assert_tree">
6             <field name="name">Tests</field>
7             <field name="model">accounting.assert.test</field>
8             <field name="arch" type="xml">
9                 <tree string="Tests">
10                     <field name="sequence"/>
11                     <field name="name"/>
12                     <field name="desc"/>
13                 </tree>
14             </field>
15         </record>
16
17         <record model="ir.ui.view" id="account_assert_form">
18             <field name="name">Tests</field>
19             <field name="model">accounting.assert.test</field>
20             <field name="arch" type="xml">
21                 <form string="Tests">
22                     <sheet>
23                         <group>
24                             <group>
25                                 <field name="name"/>
26                                 <field name="sequence"/>
27                             </group>
28                             <group>
29                                 <field name="active"/>
30                             </group>
31                         </group>
32                         <notebook>
33                             <page string="Description">
34                                 <field name="desc" nolabel="1"/>
35                             </page>
36                             <page string="Expression">
37                                 <group string="Python Code">
38                                     <field colspan="4" name="code_exec" nolabel="1"/>
39                                 </group>
40                                 <group string="Code Help">
41                                     <pre>
42 Code should always set a variable named `result` with the result of your test, that can be a list or
43 a dictionary. If `result` is an empty list, it means that the test was succesful. Otherwise it will
44 try to translate and print what is inside `result`.
45
46 If the result of your test is a dictionary, you can set a variable named `column_order` to choose in
47 what order you want to print `result`'s content.
48
49 Should you need them, you can also use the following variables into your code:
50     * cr: cursor to the database
51     * uid: ID of the current user
52
53 In any ways, the code must be legal python statements with correct indentation (if needed).
54
55 Example: 
56     sql = '''SELECT id, name, ref, date
57              FROM account_move_line 
58              WHERE account_id IN (SELECT id FROM account_account WHERE type = 'view')
59           '''
60     cr.execute(sql)
61     result = cr.dictfetchall()
62                                     </pre>
63                                 </group>
64                             </page>
65                         </notebook>
66                     </sheet>
67                 </form>
68             </field>
69         </record>
70
71         <record model="ir.actions.act_window" id="action_accounting_assert">
72             <field name="name">Accounting Tests</field>
73             <field name="res_model">accounting.assert.test</field>
74             <field name="view_mode">tree,form</field>
75             <field name="help" type="html">
76               <p class="oe_view_nocontent_create">
77                 Click to create Accounting Test.
78               </p>
79             </field>
80         </record>
81
82         <menuitem name="Accounting Tests" parent="account.menu_finance_reporting" id="menu_action_license" action="action_accounting_assert"/>
83
84     </data>
85 </openerp>