2012-10-23 11:13:01 +00:00
|
|
|
<?xml version="1.0"?>
|
|
|
|
<openerp>
|
|
|
|
<data>
|
|
|
|
|
2012-11-01 07:32:08 +00:00
|
|
|
<record model="ir.ui.view" id="account_assert_tree">
|
|
|
|
<field name="name">Tests</field>
|
|
|
|
<field name="model">accounting.assert.test</field>
|
2012-10-23 11:13:01 +00:00
|
|
|
<field name="arch" type="xml">
|
|
|
|
<tree string="Tests">
|
|
|
|
<field name="sequence"/>
|
|
|
|
<field name="name"/>
|
|
|
|
<field name="desc"/>
|
|
|
|
</tree>
|
|
|
|
</field>
|
|
|
|
</record>
|
2012-11-01 07:32:08 +00:00
|
|
|
|
|
|
|
<record model="ir.ui.view" id="account_assert_form">
|
|
|
|
<field name="name">Tests</field>
|
|
|
|
<field name="model">accounting.assert.test</field>
|
2012-10-23 11:13:01 +00:00
|
|
|
<field name="arch" type="xml">
|
2012-11-01 07:32:08 +00:00
|
|
|
<form string="Tests" version="7.0">
|
|
|
|
<sheet>
|
|
|
|
<group>
|
|
|
|
<group>
|
2012-11-01 09:45:56 +00:00
|
|
|
<field name="name"/>
|
2012-11-01 07:32:08 +00:00
|
|
|
<field name="sequence"/>
|
|
|
|
</group>
|
|
|
|
<group>
|
2012-11-01 09:45:56 +00:00
|
|
|
<field name="active"/>
|
2012-11-01 07:32:08 +00:00
|
|
|
</group>
|
|
|
|
</group>
|
2012-11-09 06:39:12 +00:00
|
|
|
<notebook>
|
2012-11-01 09:45:56 +00:00
|
|
|
<page string="Description">
|
|
|
|
<field name="desc" nolabel="1"/>
|
|
|
|
</page>
|
|
|
|
<page string="Expression">
|
|
|
|
<group string="Python Code">
|
|
|
|
<field colspan="4" name="code_exec" nolabel="1"/>
|
|
|
|
</group>
|
|
|
|
<group string="Code Help">
|
|
|
|
<pre>
|
2012-11-27 14:03:59 +00:00
|
|
|
Code should always return a result value. If result is an empty list, it means that
|
|
|
|
the test is succesful. Otherwise it will print what is inside result.
|
|
|
|
Code must be python with correct indentation (if needed).
|
|
|
|
Here is a list of function that you can use in your test :
|
|
|
|
- group(lst, col) :
|
|
|
|
- reconciled_inv() : return the list of all reconciled invoices
|
|
|
|
- get_parent(acc_id) : get parent analytical account
|
|
|
|
- now() : return current datetime
|
2012-11-27 09:49:11 +00:00
|
|
|
|
2012-11-01 09:45:56 +00:00
|
|
|
Example:
|
|
|
|
sql = 'select id, name, ref, date from account_move_line where account_id in
|
|
|
|
(select id from account_account where type = 'view')'
|
|
|
|
cr.execute(sql)
|
|
|
|
result = cr.dictfetchall()
|
|
|
|
</pre>
|
|
|
|
</group>
|
|
|
|
</page>
|
|
|
|
</notebook>
|
2012-11-01 07:32:08 +00:00
|
|
|
</sheet>
|
2012-10-23 11:13:01 +00:00
|
|
|
</form>
|
|
|
|
</field>
|
|
|
|
</record>
|
2012-11-01 07:32:08 +00:00
|
|
|
|
|
|
|
<record model="ir.actions.act_window" id="action_accounting_assert">
|
|
|
|
<field name="name">Accounting Tests</field>
|
|
|
|
<field name="res_model">accounting.assert.test</field>
|
|
|
|
<field name="view_mode">tree,form</field>
|
2012-11-09 06:39:12 +00:00
|
|
|
<field name="help" type="html">
|
|
|
|
<p class="oe_view_nocontent_create">
|
|
|
|
Click to create Accounting Test.
|
|
|
|
</p>
|
|
|
|
</field>
|
2012-11-01 07:32:08 +00:00
|
|
|
</record>
|
|
|
|
|
|
|
|
<menuitem name="Accounting Tests" parent="account.menu_finance_reporting" id="menu_action_license" action="action_accounting_assert"/>
|
2012-10-23 11:13:01 +00:00
|
|
|
|
2012-11-01 07:32:08 +00:00
|
|
|
</data>
|
2012-10-23 11:13:01 +00:00
|
|
|
</openerp>
|