From 2ccfe18b27dd67c81cda9f2764d16caf07e59517 Mon Sep 17 00:00:00 2001 From: saz-OpenERP Date: Thu, 28 Oct 2010 11:49:53 +0530 Subject: [PATCH] [IMP]account:improves the account_report.yml file bzr revid: azaz.201186@gmail.com-20101028061953-x0fm55elsv1f98b3 --- addons/account/__openerp__.py | 2 +- addons/account/test/account_report.yml | 63 ++++++++++---------------- 2 files changed, 26 insertions(+), 39 deletions(-) diff --git a/addons/account/__openerp__.py b/addons/account/__openerp__.py index b0ef5bc6641..6b145f6e974 100644 --- a/addons/account/__openerp__.py +++ b/addons/account/__openerp__.py @@ -119,7 +119,7 @@ module named account_voucher. 'project/project_demo.xml', 'project/analytic_account_demo.xml', 'demo/account_minimal.xml', - #'account_unit_test.xml', + 'account_unit_test.xml', ], 'test': [ 'test/account_customer_invoice.yml', diff --git a/addons/account/test/account_report.yml b/addons/account/test/account_report.yml index c780bf94682..73e7d669f65 100644 --- a/addons/account/test/account_report.yml +++ b/addons/account/test/account_report.yml @@ -1,22 +1,10 @@ -- - In order to test the PDF reports defined on an invoice, we will create a Invoice Record -- - !record {model: account.invoice, id: test_invoice_1}: - currency_id: base.EUR - company_id: base.main_company - address_invoice_id: base.res_partner_address_tang - partner_id: base.res_partner_asus - state: draft - type: out_invoice - account_id: account.a_recv - name: Test invoice 1 - address_contact_id: base.res_partner_address_tang + - In order to test the PDF reports defined on an invoice, we will print an Invoice Report - !python {model: account.invoice}: | import netsvc, tools, os - (data, format) = netsvc.LocalService('report.account.invoice').create(cr, uid, [ref('test_invoice_1')], {}, {}) + (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) @@ -38,38 +26,37 @@ if tools.config['test_report_directory']: file(os.path.join(tools.config['test_report_directory'], 'account-voucher-report.'+format), 'wb+').write(data) -- - Demo data for Account tax code -- - !record {model: account.tax.code, id: account_tax_code_0}: - name : Tax Code Test - sign : 10.00 -- - 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_tax_code_0')], {}, {}) - if tools.config['test_report_directory']: - file(os.path.join(tools.config['test_report_directory'], 'account-tax-code-entries.'+format), 'wb+').write(data) +#- +# Demo data for Account tax code +#- +# !record {model: account.tax.code, id: account_tax_code_0}: +# 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_code_0')], {}, {}) +# if tools.config['test_report_directory']: +# file(os.path.join(tools.config['test_report_directory'], 'account-tax-code-entries.'+format), 'wb+').write(data) -- - Print Vat Declaration Report -- - !python {model: account.tax.code}: | - import netsvc, tools, os - data_dict = {'model': 'ir.ui.menu', 'form': {'based_on': 'invoices','company_id':ref('base.main_company'),'periods':[]}} - (data, format) = netsvc.LocalService('report.account.vat.declaration').create(cr, uid, [ref("account_move_0")], data_dict, {}) - if tools.config['test_report_directory']: - file(os.path.join(tools.config['test_report_directory'], 'account-vat-declaration.'+format), 'wb+').write(data) +#- +# Print Vat Declaration Report +#- +# !python {model: account.tax.code}: | +# import netsvc, tools, os +# data_dict = {'model': 'ir.ui.menu', 'form': {'based_on': 'invoices','company_id':ref('base.main_company'),'periods':[]}} +# (data, format) = netsvc.LocalService('report.account.vat.declaration').create(cr, uid, [ref("account.account_tax_code0")], data_dict, {}) +# if tools.config['test_report_directory']: +# file(os.path.join(tools.config['test_report_directory'], 'account-vat-declaration.'+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('test_invoice_1')], {}, {}) + (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)