summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCedric Snauwaert <csn@openerp.com>2012-11-27 15:03:59 +0100
committerCedric Snauwaert <csn@openerp.com>2012-11-27 15:03:59 +0100
commit2d123cbdc6fc22aa56e2f5a53a4022e0f5aa8e8d (patch)
tree8162c4b70e25fdd3d1cf0e8c5cf67842ade79184
parent7722389ade0b6c2b55c11f321b726c0d854075e3 (diff)
[REF]remove some unused lines and add some tips message
bzr revid: csn@openerp.com-20121127140359-pvf025717k4m2wsu
-rw-r--r--addons/account_test/__openerp__.py7
-rw-r--r--addons/account_test/account_test_data.xml4
-rw-r--r--addons/account_test/account_test_demo.xml30
-rw-r--r--addons/account_test/account_test_view.xml16
4 files changed, 13 insertions, 44 deletions
diff --git a/addons/account_test/__openerp__.py b/addons/account_test/__openerp__.py
index 3e98734fe72..cfd4007fed0 100644
--- a/addons/account_test/__openerp__.py
+++ b/addons/account_test/__openerp__.py
@@ -29,6 +29,10 @@
Asserts on accounting.
======================
With this module you can manually check consistencies and inconsistencies of accounting module from menu Reporting/Accounting/Accounting Tests.
+
+You can write a query in order to create Consistency Test and you will get the result of the test
+in PDF format which can be accessed by Menu Reporting -> Accounting Tests, then select the test
+and print the report from Print button in header area.
""",
'depends' : ['account'],
'data' : [
@@ -37,9 +41,6 @@ With this module you can manually check consistencies and inconsistencies of acc
'account_test_report.xml',
'account_test_data.xml',
],
- 'demo': [
- 'account_test_demo.xml',
- ],
'active': False,
'installable': True
}
diff --git a/addons/account_test/account_test_data.xml b/addons/account_test/account_test_data.xml
index 2a23c1196f9..4970bef6a0d 100644
--- a/addons/account_test/account_test_data.xml
+++ b/addons/account_test/account_test_data.xml
@@ -22,7 +22,7 @@ if res[0]['balance']!=0.0 and res[0]['balance'] is not None:
<record model="accounting.assert.test" id="account_test_02">
<field name="sequence">2</field>
<field name="name">Test 2: Opening a fiscal year</field>
- <field name="desc">Displays the debit and credit amount, of closed and newly created fiscal year, if the balance of current and newly created fiscal year mismatch</field>
+ <field name="desc">Check if the balance of the new opened fiscal year matches with last year's balance</field>
<field name="code_exec"><![CDATA[result = []
cr.execute("select coalesce(sum(debit),0) as debit_new_fyear,coalesce(sum(credit),0) as credit_new_fyear from account_move_line where period_id in (select id from account_period where state='draft' and special order by id desc limit 1);")
rec = cr.dictfetchall()
@@ -92,7 +92,6 @@ records= cr.dictfetchall()
rec = [r['id'] for r in records]
res = reconciled_inv()
invoices = set(rec).difference(set(res))
-groups = group(list(records),'number')
result = [rec for rec in records if rec['id'] in invoices]
if result:
result.insert(0,_('* Invoices that need to be checked: '))
@@ -108,7 +107,6 @@ result=[]
if res:
cr.execute("SELECT distinct inv.number,inv.id from account_invoice inv, account_move_line ml, account_account a, account_move m where m.id=ml.move_id and inv.move_id=m.id and inv.id=inv.move_id and ml.reconcile_id is null and a.type in ('receivable','payable') and ml.account_id=a.id and inv.id in %s",(tuple(res),))
records = cr.dictfetchall()
- groups = group(list(records),'number')
result = [rec for rec in records]
if result:
result.insert(0,_('* Invoices that need to be checked: '))
diff --git a/addons/account_test/account_test_demo.xml b/addons/account_test/account_test_demo.xml
deleted file mode 100644
index 7dd5c0f8938..00000000000
--- a/addons/account_test/account_test_demo.xml
+++ /dev/null
@@ -1,30 +0,0 @@
-<?xml version="1.0"?>
-<openerp>
-<data>
-
- <record model="accounting.assert.test" id="account_test_demo_01">
- <field name="sequence">11</field>
- <field name="name">Test 11: Consistency check between Account Move and Account Move Line</field>
- <field name="desc">Checks id of 'account_move' = move_id of 'account_move_line', and state of 'account_move_line' is valid, and having sum(debit-credit) != 0</field>
- <field name="domain_exec"></field>
- <field name="code_exec"><![CDATA[sql="""SELECT
- sum(debit) as sum_debit,
- sum(credit) as sum_credit,
- sum(debit-credit) as balance,
- am.id as move_id,
- am.state,
- am.period_id
- FROM account_move am, account_move_line ml
- WHERE
- ml.move_id = am.id
- AND
- ml.state = 'valid'
- GROUP BY am.name, am.id, am.state, am.period_id
- HAVING abs(sum(ml.debit-ml.credit)) <> 0"""
-cr.execute(sql)
-result = cr.dictfetchall()
-]]></field>
- </record>
-
-</data>
-</openerp>
diff --git a/addons/account_test/account_test_view.xml b/addons/account_test/account_test_view.xml
index 46f02d81d3b..1faca55c4d6 100644
--- a/addons/account_test/account_test_view.xml
+++ b/addons/account_test/account_test_view.xml
@@ -39,15 +39,15 @@
</group>
<group string="Code Help">
<pre>
-You can write a query in order to create Consistency Test and you will get the result of the test
-in PDF format which can be accessed by Menu Reporting -> Accounting Tests, then select the test
-and print the report from Print button in header area.
+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
-You can also use the following functions:
-
-get_parent(acc_id) : return parent id of analytic account(acc_id)
-reconciled_inv() : returns ids of records which are reconciled
-
Example:
sql = 'select id, name, ref, date from account_move_line where account_id in
(select id from account_account where type = 'view')'