summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnup (OpenERP) <ach@tinyerp.com>2010-09-16 18:57:57 +0530
committerAnup (OpenERP) <ach@tinyerp.com>2010-09-16 18:57:57 +0530
commitd8946eb67ea4dfe20c0bb5f2c185a67325dbede9 (patch)
treea8036221de75b54428e959b85c7245a826a3e1ce
parent576b7ddef0bd59cdbf22623a7e94760865fab6bf (diff)
[IMP] account_budget : YML test added for reports
bzr revid: ach@tinyerp.com-20100916132757-s33ooyffhrubu5g4
-rw-r--r--addons/account_budget/__openerp__.py1
-rw-r--r--addons/account_budget/test/account_budget_report.yml27
2 files changed, 28 insertions, 0 deletions
diff --git a/addons/account_budget/__openerp__.py b/addons/account_budget/__openerp__.py
index f47e4685246..5d6d8da0def 100644
--- a/addons/account_budget/__openerp__.py
+++ b/addons/account_budget/__openerp__.py
@@ -63,6 +63,7 @@ Three reports are available:
'demo_xml': ['crossovered_budget_demo.xml'],
'test':[
'test/account_budget.yml',
+ 'test/account_budget_report.yml',
],
'installable': True,
'active': False,
diff --git a/addons/account_budget/test/account_budget_report.yml b/addons/account_budget/test/account_budget_report.yml
new file mode 100644
index 00000000000..fa086e24a64
--- /dev/null
+++ b/addons/account_budget/test/account_budget_report.yml
@@ -0,0 +1,27 @@
+-
+ Print the Analytic Budget Report in Normal mode
+-
+ !python {model: account.analytic.account}: |
+ import netsvc, tools, os, time
+ data_dict = {'model': 'account.analytic.account', 'form': {'date1':time.strftime("%Y-01-01"),'date2':time.strftime('%Y-%m-%d'),'id':ref('account.analytic_root'),'context':{}}}
+ (data, format) = netsvc.LocalService('report.account.analytic.account.budget').create(cr, uid, [ref('account.analytic_root')], data_dict, {})
+ if tools.config['test_report_directory']:
+ file(os.path.join(tools.config['test_report_directory'], 'account_budget-analytic_budget_report.'+format), 'wb+').write(data)
+-
+ Print the Budget Report in Normal mode
+-
+ !python {model: account.budget.post}: |
+ import netsvc, tools, os, time
+ data_dict = {'model': 'account.budget.post', 'form': {'date1':time.strftime("%Y-01-01"),'date2':time.strftime('%Y-%m-%d'),'id':ref('account_budget.account_budget_post_sales0'),'context':{}}}
+ (data, format) = netsvc.LocalService('report.account.analytic.account.budget').create(cr, uid, [ref('account_budget.account_budget_post_sales0')], data_dict, {})
+ if tools.config['test_report_directory']:
+ file(os.path.join(tools.config['test_report_directory'], 'account_budget-budget_report.'+format), 'wb+').write(data)
+-
+ Print the Cross Overed Budget Report in Normal mode
+-
+ !python {model: crossovered.budget}: |
+ import netsvc, tools, os, time
+ data_dict = {'model': 'account.budget.post', 'form': {'date_from':time.strftime("%Y-01-01"),'date_to':time.strftime('%Y-%m-%d'),'report':'analytic-full','id':ref('account_budget.crossovered_budget_budgetoptimistic0'),'context':{}}}
+ (data, format) = netsvc.LocalService('report.crossovered.budget.report').create(cr, uid, [ref('account_budget.crossovered_budget_budgetoptimistic0')], data_dict, {})
+ if tools.config['test_report_directory']:
+ file(os.path.join(tools.config['test_report_directory'], 'account_budget-crossovered_budget_report.'+format), 'wb+').write(data) \ No newline at end of file