From 416220ea9040ed5dcc762b7b67b8baa0756981a9 Mon Sep 17 00:00:00 2001 From: "Jay (OpenERP)" Date: Thu, 16 Sep 2010 22:08:39 +0530 Subject: [PATCH] [IMP/FIX] Account : More yml test for reports bzr revid: jvo@tinyerp.com-20100916163839-wraq5zl13tb0xdow --- addons/account/report/tax_report.py | 2 -- addons/account/test/account_report.yml | 44 +++++++++++++++++++++++--- 2 files changed, 40 insertions(+), 6 deletions(-) diff --git a/addons/account/report/tax_report.py b/addons/account/report/tax_report.py index 15607a79011..a89335f99c5 100644 --- a/addons/account/report/tax_report.py +++ b/addons/account/report/tax_report.py @@ -212,10 +212,8 @@ class tax_report(rml_parse.rml_parse): result_accounts.append(account_elem) ind+=1 - return result_accounts - report_sxw.report_sxw('report.account.vat.declaration', 'account.tax.code', 'addons/account/report/tax_report.rml', parser=tax_report, header="internal") diff --git a/addons/account/test/account_report.yml b/addons/account/test/account_report.yml index fbb2c9effb3..3dc65b10219 100644 --- a/addons/account/test/account_report.yml +++ b/addons/account/test/account_report.yml @@ -12,10 +12,33 @@ - !python {model: res.partner}: | import netsvc, tools, os - (data, format) = netsvc.LocalService('report.account.overdue').create(cr, uid, [ref('base.res_partner_asus'),ref('base.res_partner_agrolait'),ref('base.res_partner_c2c'),ref('base.res_partner_sednacom'),ref('base.res_partner_thymbra'),ref('base.res_partner_desertic_hispafuentes'),ref('base.res_partner_tinyatwork'),ref('base.res_partner_2'),ref('base.res_partner_3'),ref('base.res_partner_4'),ref('base.res_partner_5'),ref('base.res_partner_6'),ref('base.res_partner_maxtor'),ref('base.res_partner_seagate'),ref('base.res_partner_8'),ref('base.res_partner_9'),ref('base.res_partner_10'),ref('base.res_partner_11'),ref('base.res_partner_14'),ref('base.res_partner_15'),ref('base.res_partner_accent')], {}, {}) + (data, format) = netsvc.LocalService('report.account.overdue').create(cr, uid, [ref('base.res_partner_asus'),ref('base.res_partner_agrolait'),ref('base.res_partner_c2c')], {}, {}) if tools.config['test_report_directory']: file(os.path.join(tools.config['test_report_directory'], 'account-report_overdue.'+format), 'wb+').write(data) +#- +# Demo data for Account tax code +#- +# !record {model: account.tax.code, id: account_tax_code0}: +# name : Tax Code Test +#- +# Print Tax Code entries report +#- +# !python {model: account.tax.code}: | +# import netsvc, tools, os +# (data, format) = netsvc.LocalService('report.account.tax.code.entries').create(cr, uid, [ref("account.account_tax_code0")], {}, {}) +# if tools.config['test_report_directory']: +# file(os.path.join(tools.config['test_report_directory'], 'account-tax-code-entries.'+format), 'wb+').write(data) + +- + In order to test the PDF reports defined on an invoice, we will print an invoice +- + !python {model: account.invoice}: | + import netsvc, tools, os + (data, format) = netsvc.LocalService('report.account.invoice').create(cr, uid, [ref('account.test_invoice_1')], {}, {}) + if tools.config['test_report_directory']: + file(os.path.join(tools.config['test_report_directory'], 'account-invoice.'+format), 'wb+').write(data) + - Print the Aged Partner Balance Report - @@ -41,15 +64,26 @@ file(os.path.join(tools.config['test_report_directory'], 'account-aged_partner_balance.'+format), 'wb+').write(data) - - Print the Account Balance Report in Landscape mode + Print the Compare Account Balance Report in Normal mode +- + !python {model: account.account}: | + import netsvc, tools, os, time + data_dict = {'model': 'account.account', 'form': {'id':ref('account.bal'),'chart_account_id':ref('account.chart0'),'select_account': False,'format_perc':0,'show_columns' :0, 'compare_pattern': 'none','account_choice': 'moves','landscape':0,'period_manner': 'actual','fiscalyear': [ref('account.data_fiscalyear')] ,'target_move': 'all','periods': [],'context':{'state':'all'}}} + (data, format) = netsvc.LocalService('report.account.balance.account.balance').create(cr, uid, [ref('account.bal'),ref('account.gpf')], data_dict, {'periods': []}) + if tools.config['test_report_directory']: + file(os.path.join(tools.config['test_report_directory'], 'account-compare-account_balance.'+format), 'wb+').write(data) + +- + Print the Compare Account Balance Report in Landscape mode - !python {model: account.account}: | import netsvc, tools, os, time data_dict = {'model': 'account.account', 'form': {'id':ref('account.bal'),'chart_account_id':ref('account.chart0'),'select_account': False,'format_perc':0,'show_columns' :0, 'compare_pattern': 'none','account_choice': 'moves','landscape':1,'period_manner': 'actual','fiscalyear': [ref('account.data_fiscalyear')] ,'target_move': 'all','periods': [],'context':{'state':'all'}}} (data, format) = netsvc.LocalService('report.account.account.balance.landscape').create(cr, uid, [ref('account.bal'),ref('account.gpf')], data_dict, {'periods': []}) if tools.config['test_report_directory']: - file(os.path.join(tools.config['test_report_directory'], 'account-account_balance-landscape.'+format), 'wb+').write(data) + file(os.path.join(tools.config['test_report_directory'], 'account-compare-account_balance-landscape.'+format), 'wb+').write(data) + - Print the Account Balance Sheet in Hotizontal mode - @@ -248,4 +282,6 @@ data_dict = {'model': 'ir.ui.menu', 'form': {'display_type': True,'chart_account_id':ref('account.chart0'),'display_account':'bal_all','filter': 'filter_no','amount_currency': 0,'landscape':0,'period_manner': 'actual','fiscalyear_id': fy_id ,'query_line':'True ','target_move': 'all','periods': period_list,'journal_ids':journal_ids,'id':ref('account.bal'),'active_ids':acc_ids }} (data, format) = netsvc.LocalService('report.pl.account.horizontal').create(cr, uid, [], data_dict, {}) if tools.config['test_report_directory']: - file(os.path.join(tools.config['test_report_directory'], 'account-profit-loss-horizontal.'+format), 'wb+').write(data) \ No newline at end of file + file(os.path.join(tools.config['test_report_directory'], 'account-profit-loss-horizontal.'+format), 'wb+').write(data) + + \ No newline at end of file