From 5601e8e984615953e0b8a80f8831b3001dfca7e4 Mon Sep 17 00:00:00 2001 From: "ARA (OpenERP)" Date: Tue, 19 Oct 2010 16:44:23 +0530 Subject: [PATCH] [FIX] account,account_invoice_layout,l10n_ch,report_intrastate: Fix the warning of account.invoice bzr revid: ara@tinyerp.com-20101019111423-lv2fndb2rvuw920v --- addons/account/test/account_report.yml | 17 ++++++++++++-- .../test/account_invoice_layout_report.yml | 23 +++++++++++++++---- addons/l10n_ch/test/l10n_ch_report.yml | 19 ++++++++++++--- .../test/report_instratat_report.yml | 17 ++++++++++++-- 4 files changed, 64 insertions(+), 12 deletions(-) diff --git a/addons/account/test/account_report.yml b/addons/account/test/account_report.yml index 26888cc69c1..c780bf94682 100644 --- a/addons/account/test/account_report.yml +++ b/addons/account/test/account_report.yml @@ -1,9 +1,22 @@ +- + 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('account.test_invoice_1')], {}, {}) + (data, format) = netsvc.LocalService('report.account.invoice').create(cr, uid, [ref('test_invoice_1')], {}, {}) if tools.config['test_report_directory']: file(os.path.join(tools.config['test_report_directory'], 'account-invoice.'+format), 'wb+').write(data) @@ -56,7 +69,7 @@ - !python {model: account.invoice}: | import netsvc, tools, os - (data, format) = netsvc.LocalService('report.account.invoice').create(cr, uid, [ref('account.test_invoice_1')], {}, {}) + (data, format) = netsvc.LocalService('report.account.invoice').create(cr, uid, [ref('test_invoice_1')], {}, {}) if tools.config['test_report_directory']: file(os.path.join(tools.config['test_report_directory'], 'account-invoice.'+format), 'wb+').write(data) diff --git a/addons/account_invoice_layout/test/account_invoice_layout_report.yml b/addons/account_invoice_layout/test/account_invoice_layout_report.yml index b7b1c1e76cc..0c1f2df7954 100644 --- a/addons/account_invoice_layout/test/account_invoice_layout_report.yml +++ b/addons/account_invoice_layout/test/account_invoice_layout_report.yml @@ -1,9 +1,22 @@ +- + In order to Print the Invoice layout report in Normal Mode, 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 - Print the Invoice layout report in Normal Mode -- +- !python {model: account.invoice}: | import netsvc, tools, os - (data, format) = netsvc.LocalService('report.account.invoice.layout').create(cr, uid, [ref('account.test_invoice_1')], {}, {}) + (data, format) = netsvc.LocalService('report.account.invoice.layout').create(cr, uid, [ref('test_invoice_1')], {}, {}) if tools.config['test_report_directory']: file(os.path.join(tools.config['test_report_directory'], 'account_invoice_layout.'+format), 'wb+').write(data) - @@ -11,7 +24,7 @@ - !python {model: account.invoice}: | import netsvc, tools, os, time - data_dict = {'model': 'account.invoice', 'form': {'message':ref('account_invoice_layout.demo_message1'),'id':ref('account.test_invoice_1'),'context':{}}} - (data, format) = netsvc.LocalService('report.notify_account.invoice').create(cr, uid, [ref('account.test_invoice_1')], data_dict, {}) + data_dict = {'model': 'account.invoice', 'form': {'message':ref('account_invoice_layout.demo_message1'),'id':ref('test_invoice_1'),'context':{}}} + (data, format) = netsvc.LocalService('report.notify_account.invoice').create(cr, uid, [ref('test_invoice_1')], data_dict, {}) if tools.config['test_report_directory']: - file(os.path.join(tools.config['test_report_directory'], 'account_invoice_layout_message_report.'+format), 'wb+').write(data) \ No newline at end of file + file(os.path.join(tools.config['test_report_directory'], 'account_invoice_layout_message_report.'+format), 'wb+').write(data) \ No newline at end of file diff --git a/addons/l10n_ch/test/l10n_ch_report.yml b/addons/l10n_ch/test/l10n_ch_report.yml index a8a976bc424..24f7a9154ec 100644 --- a/addons/l10n_ch/test/l10n_ch_report.yml +++ b/addons/l10n_ch/test/l10n_ch_report.yml @@ -1,11 +1,24 @@ +- + In order to test the PDF reports defined on a l10n_ch, 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 a l10n_ch, we will print BVR Report - !python {model: account.invoice}: | import netsvc, tools, os - run_str = 'cp ' + tools.config['addons_path'] + '/l10n_ch/report/ocrbb.ttf' + ' ' + '/tmp/ocrbb.ttf' + run_str = 'cp ' + tools.config['addons_path'] + '/l10n_ch/report/ocrbb.ttf' + ' ' + '/tmp/ocrbb.ttf' os.system(run_str) - (data, format) = netsvc.LocalService('report.l10n_ch.bvr').create(cr, uid, [ref('account.test_invoice_1')], {}, {}) + (data, format) = netsvc.LocalService('report.l10n_ch.bvr').create(cr, uid, [ref('test_invoice_1')], {}, {}) if tools.config['test_report_directory']: file(os.path.join(tools.config['test_report_directory'], 'l10ch-bvr_report.'+format), 'wb+').write(data) @@ -14,6 +27,6 @@ - !python {model: account.invoice}: | import netsvc, tools, os - (data, format) = netsvc.LocalService('report.l10n_ch.invoice.bvr').create(cr, uid, [ref('account.test_invoice_1')], {}, {}) + (data, format) = netsvc.LocalService('report.l10n_ch.invoice.bvr').create(cr, uid, [ref('test_invoice_1')], {}, {}) if tools.config['test_report_directory']: file(os.path.join(tools.config['test_report_directory'], 'l10ch-bvr_invoice_report.'+format), 'wb+').write(data) diff --git a/addons/report_intrastat/test/report_instratat_report.yml b/addons/report_intrastat/test/report_instratat_report.yml index c6162f51c25..858f9330358 100644 --- a/addons/report_intrastat/test/report_instratat_report.yml +++ b/addons/report_intrastat/test/report_instratat_report.yml @@ -1,8 +1,21 @@ +- + In order to test the PDF reports defined using report_instratat module, 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 using report_instratat module, we print a Instratat Report -- +- !python {model: account.invoice}: | import netsvc, tools, os - (data, format) = netsvc.LocalService('report.account.invoice.intrastat').create(cr, uid, [ref('account.test_invoice_1')], {}, {}) + (data, format) = netsvc.LocalService('report.account.invoice.intrastat').create(cr, uid, [ref('test_invoice_1')], {}, {}) if tools.config['test_report_directory']: file(os.path.join(tools.config['test_report_directory'], 'report_instratat-instrastat_report.'+format), 'wb+').write(data)