From d8946eb67ea4dfe20c0bb5f2c185a67325dbede9 Mon Sep 17 00:00:00 2001 From: "Anup (OpenERP)" Date: Thu, 16 Sep 2010 18:57:57 +0530 Subject: [PATCH] [IMP] account_budget : YML test added for reports bzr revid: ach@tinyerp.com-20100916132757-s33ooyffhrubu5g4 --- addons/account_budget/__openerp__.py | 1 + .../test/account_budget_report.yml | 27 +++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 addons/account_budget/test/account_budget_report.yml 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