[IMP] Account_voucher : YML test added for reports

bzr revid: jvo@tinyerp.com-20100917130900-x624xz5tasmi8w70
This commit is contained in:
Jay (OpenERP)
2010-09-17 18:39:00 +05:30
parent 14f4df40dc
commit c78bd45a44
4 changed files with 58 additions and 40 deletions
+23 -22
View File
@@ -25,29 +25,30 @@
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
#-
# 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)
-
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_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_tax_code_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
-
+1
View File
@@ -52,6 +52,7 @@
# "test/account_voucher.yml",
# "test/sales_receipt.yml",
# "test/sales_payment.yml",
"test/account_voucher_report.yml"
],
'certificate': '0037580727101',
"active": False,
@@ -95,21 +95,3 @@
!python {model: account.voucher}: |
acc_id=self.browse(cr, uid, ref("account_voucher_voucheraxelor0"))
assert(acc_id.move_id)
-
In order to test the PDF reports defined on a account_voucher, we will print account voucher amount Report
-
!python {model: account.voucher}: |
import netsvc, tools, os
(data, format) = netsvc.LocalService('report.voucher.cash_amount').create(cr, uid, [ref("account_voucher_voucheraxelor0")], {}, {})
if tools.config['test_report_directory']:
file(os.path.join(tools.config['test_report_directory'], 'account_voucher-amount.'+format), 'wb+').write(data)
-
In order to test the PDF reports defined on a account_voucher, we will print account voucher Report
-
!python {model: account.voucher}: |
import netsvc, tools, os
(data, format) = netsvc.LocalService('report.voucher.cash_receipt.drcr').create(cr, uid, [ref("account_voucher_voucheraxelor0")], {}, {})
if tools.config['test_report_directory']:
file(os.path.join(tools.config['test_report_directory'], 'account_voucher-report.'+format), 'wb+').write(data)
@@ -0,0 +1,34 @@
-
Demo for Account Voucher
-
!record {model: account.voucher, id: account_voucher_voucheraxelor0}:
account_id: account.cash
company_id: base.main_company
currency_id: base.EUR
journal_id: account.bank_journal
name: Voucher Axelor
narration: Basic PC
amount: 1000.0
line_ids:
- account_id: account.cash
amount: 1000.0
name: Voucher Axelor
period_id: account.period_6
-
In order to test the PDF reports defined on a account_voucher, we will print account voucher amount Report
-
!python {model: account.voucher}: |
import netsvc, tools, os
(data, format) = netsvc.LocalService('report.voucher.cash_amount').create(cr, uid, [ref("account_voucher_voucheraxelor0")], {}, {})
if tools.config['test_report_directory']:
file(os.path.join(tools.config['test_report_directory'], 'account_voucher-amount.'+format), 'wb+').write(data)
-
In order to test the PDF reports defined on a account_voucher, we will print account voucher Report
-
!python {model: account.voucher}: |
import netsvc, tools, os
(data, format) = netsvc.LocalService('report.voucher.cash_receipt.drcr').create(cr, uid, [ref("account_voucher_voucheraxelor0")], {}, {})
if tools.config['test_report_directory']:
file(os.path.join(tools.config['test_report_directory'], 'account_voucher-report.'+format), 'wb+').write(data)