From 5eb9eaecfa32d6f2b35582e31ac78bf3507334e9 Mon Sep 17 00:00:00 2001 From: "Jas (OpenERP)" Date: Wed, 22 Dec 2010 18:30:49 +0530 Subject: [PATCH] [Imp] account_budget : improved yml file for report bzr revid: jas@tinyerp.com-20101222130049-0vexw8vc9s6aplv4 --- .../test/account_budget_report.yml | 46 +++++++++++++++---- 1 file changed, 36 insertions(+), 10 deletions(-) diff --git a/addons/account_budget/test/account_budget_report.yml b/addons/account_budget/test/account_budget_report.yml index d0766e31196..6ee1b64544e 100644 --- a/addons/account_budget/test/account_budget_report.yml +++ b/addons/account_budget/test/account_budget_report.yml @@ -1,12 +1,25 @@ - - Print the Analytic Budget Report in Normal mode + Print the Analytic Budget Report mode through wizard - !python {model: account.analytic.account}: | import netsvc, tools, os, time - data_dict = {'model': 'account.analytic.account', 'form': {'date_from':time.strftime("%Y-01-01"),'date_to':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) + ctx={} + ctx.update({'model': 'account.analytic.account','active_ids': [ref('account.analytic_root')]}) + data_dict = {} + from tools import test_reports + test_reports.try_report_action(cr, uid, 'action_account_budget_analytic',wiz_data=data_dict, context=ctx, our_module='account_budget') + +#- +# Print the Budget Report mode through wizard +#- +# !python {model: account.budget.post}: | +# import netsvc, tools, os, time +# ctx={} +# ctx.update({'model': 'account.budget.post','active_ids': [ref('account_budget.account_budget_post_sales0')]}) +# data_dict = {} +# from tools import test_reports +# test_reports.try_report_action(cr, uid, 'action_account_budget_analytic',wiz_data=data_dict, context=ctx, our_module='account_budget') + - Print the Budget Report in Normal mode - @@ -16,12 +29,25 @@ (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 CrossOvered Budget Report in Normal mode + Print the CrossOvered Budget Report mode through wizard - !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) + ctx={} + ctx.update({'model': 'account.budget.post','active_ids': [ref('account_budget.crossovered_budget_budgetoptimistic0')]}) + data_dict = {} + from tools import test_reports + test_reports.try_report_action(cr, uid, 'action_account_budget_crossvered_report',wiz_data=data_dict, context=ctx, our_module='account_budget') + +#- +# Print the CrossOvered summary Report mode through wizard +#- +# !python {model: crossovered.budget}: | +# import netsvc, tools, os, time +# ctx={} +# ctx.update({'model': 'account.budget.post','active_ids': []}) +# data_dict = {} +# from tools import test_reports +# test_reports.try_report_action(cr, uid, 'action_account_budget_crossvered_summary_report',wiz_data=data_dict, context=ctx, our_module='account_budget')