[IMP] account_reporting : YML test for report added

bzr revid: ach@tinyerp.com-20100916170541-04lc7ihk3t62a5vc
This commit is contained in:
Anup (OpenERP)
2010-09-16 22:35:41 +05:30
parent c1bc66368e
commit 8e79e7a220
3 changed files with 20 additions and 1 deletions
+2 -1
View File
@@ -36,7 +36,8 @@
'account_data.xml',
'wizard/account_reporting_balance_report_view.xml',
],
'demo_xml': [],
'demo_xml': ['account_reporting_demo.xml'],
'test': ['test/account_reporting_report.yml'],
'installable': True,
'active': False,
'certificate': '0072305016797',
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data noupdate="1">
<record id="account_balance_sheet_1" model="account.report.bs">
<field name="name">My Balance Sheet</field>
<field name="code">MBS</field>
</record>
</data>
</openerp>
@@ -0,0 +1,9 @@
-
Print the Balance Sheet Report in Normal mode
-
!python {model: account.report.bs }: |
import netsvc, tools, os, time
data_dict = {'model': 'account.report.bs', 'form': {'fiscalyear':ref('account.data_fiscalyear'),'periods':[ref('account.period_1'),ref('account.period_2'),ref('account.period_3')],'context':{}}}
(data, format) = netsvc.LocalService('report.account.report.bs').create(cr, uid, [ref('account_reporting.account_balance_sheet_1')], data_dict, {})
if tools.config['test_report_directory']:
file(os.path.join(tools.config['test_report_directory'], 'account_reporting-balance_sheet_report.'+format), 'wb+').write(data)