diff --git a/addons/account/test/account_report.yml b/addons/account/test/account_report.yml index 44899ec1d8d..0048de7af46 100644 --- a/addons/account/test/account_report.yml +++ b/addons/account/test/account_report.yml @@ -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 - diff --git a/addons/account_voucher/__openerp__.py b/addons/account_voucher/__openerp__.py index 824ca746f37..752bb74f90c 100644 --- a/addons/account_voucher/__openerp__.py +++ b/addons/account_voucher/__openerp__.py @@ -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, diff --git a/addons/account_voucher/test/account_voucher.yml b/addons/account_voucher/test/account_voucher.yml index 67d26cbdbb1..b63bfc9d129 100644 --- a/addons/account_voucher/test/account_voucher.yml +++ b/addons/account_voucher/test/account_voucher.yml @@ -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) diff --git a/addons/account_voucher/test/account_voucher_report.yml b/addons/account_voucher/test/account_voucher_report.yml new file mode 100644 index 00000000000..eddb313c776 --- /dev/null +++ b/addons/account_voucher/test/account_voucher_report.yml @@ -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)