[IMP] account_budget : YML test added for reports
bzr revid: ach@tinyerp.com-20100916132757-s33ooyffhrubu5g4
This commit is contained in:
parent
576b7ddef0
commit
d8946eb67e
|
@ -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,
|
||||
|
|
|
@ -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)
|
Loading…
Reference in New Issue