[IMP]account:improves the account_report.yml file

bzr revid: azaz.201186@gmail.com-20101028061953-x0fm55elsv1f98b3
This commit is contained in:
saz-OpenERP 2010-10-28 11:49:53 +05:30
parent 34d8146b35
commit 2ccfe18b27
2 changed files with 26 additions and 39 deletions

View File

@ -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',

View File

@ -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)