Modified Assertion test for parent_id(as we changed the type of parent_id from many2m...
[odoo/odoo.git] / addons / account / account_assert_test.xml
1 <?xml version="1.0" encoding="utf-8"?>
2 <terp>
3     <data>
4         <assert model="account.move" search="[]" string="For all account moves, the state is valid implies that the sum of credits equals the sum of debits">
5             <test expr="not len(line_id) or line_id[0].state != 'valid' or (sum([l.debit - l.credit for l in line_id]) &lt;= 0.00001)"/>
6         </assert>
7
8         <!--assert model="account.invoice" search="[]" string="If the invoice is paid, third party accounting lines must be reconciled">
9                         <test expr="not state == 'paid' or ..." />
10                 </assert-->
11
12         <assert model="account.account" search="[]" string="For all accounts, the balance is equal to the sum of the balance of its childs">
13             <test expr="not len(child_id) or (balance - sum([c.balance for c in child_id]) &lt;= 0.00001)"/>
14         </assert>
15
16         <assert model="account.move.line" search="[('account_id.type', '=', 'view')]" string="Accounts of view type do not contain any move line">
17             <test expr="False"/>
18         </assert>
19
20         <assert model="account.invoice" search="[('state', 'in', ['paid', 'open'])]" string="The total amount of all paid or open invoices is correctly computed">
21             <test expr="sum([l.price_subtotal for l in invoice_line]) - amount_untaxed &lt;= 0.00001"/>
22         </assert>
23
24         <assert model="account.move.reconcile" search="[]" string="For each reconciliation, the sum of credits equals the sum of debits">
25             <test expr="sum([l.debit - l.credit for l in line_id]) &lt;= 0.00001"/>
26         </assert>
27
28         <assert model="account.account" search="[]" string="Every account must have at least one parent account of type '0'">
29             <test expr="not parent_id or (code!='0')"/>
30         </assert>
31     </data>
32 </terp>