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">
10 <field name="sequence"/>
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" version="7.0">
26 <field name="sequence"/>
29 <field name="active"/>
33 <page string="Description">
34 <field name="desc" nolabel="1"/>
36 <page string="Expression">
37 <group string="Python Code">
38 <field colspan="4" name="code_exec" nolabel="1"/>
40 <group string="Code Help">
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`.
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.
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
53 In any ways, the code must be legal python statements with correct indentation (if needed).
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')
61 result = cr.dictfetchall()
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.
82 <menuitem name="Accounting Tests" parent="account.menu_finance_reporting" id="menu_action_license" action="action_accounting_assert"/>