From 12d4d294d95bfbd61787136ba63aab006e9d1b23 Mon Sep 17 00:00:00 2001 From: "Anup (OpenERP)" Date: Thu, 16 Sep 2010 20:00:48 +0530 Subject: [PATCH] [FIX] account_invoice_layout : YML test for report added bzr revid: ach@tinyerp.com-20100916143048-p91ljsi6gklyb5xe --- addons/account_invoice_layout/__openerp__.py | 3 ++- .../account_invoice_layout_demo.xml | 14 ++++++++++++++ .../report/report_account_invoice_layout.rml | 8 ++++---- .../test/account_invoice_layout_report.yml | 17 +++++++++++++++++ 4 files changed, 37 insertions(+), 5 deletions(-) create mode 100644 addons/account_invoice_layout/account_invoice_layout_demo.xml create mode 100644 addons/account_invoice_layout/test/account_invoice_layout_report.yml diff --git a/addons/account_invoice_layout/__openerp__.py b/addons/account_invoice_layout/__openerp__.py index 77a6e428de6..36eeb41b137 100644 --- a/addons/account_invoice_layout/__openerp__.py +++ b/addons/account_invoice_layout/__openerp__.py @@ -45,7 +45,8 @@ 'account_invoice_layout_report.xml', 'wizard/account_invoice_special_message.xml', ], - 'demo_xml': [], + 'demo_xml': ['account_invoice_layout_demo.xml'], + 'test':['test/account_invoice_layout_report.yml'], 'installable': True, 'active': False, 'certificate': '0057235078173', diff --git a/addons/account_invoice_layout/account_invoice_layout_demo.xml b/addons/account_invoice_layout/account_invoice_layout_demo.xml new file mode 100644 index 00000000000..cb8df67d997 --- /dev/null +++ b/addons/account_invoice_layout/account_invoice_layout_demo.xml @@ -0,0 +1,14 @@ + + + + + + OpenERP SA + ERP & CRM Solutions.... + + + Tiny sprl + Be Expert with the Experts... + + + \ No newline at end of file diff --git a/addons/account_invoice_layout/report/report_account_invoice_layout.rml b/addons/account_invoice_layout/report/report_account_invoice_layout.rml index 77781c4191d..8f7d5f561e8 100644 --- a/addons/account_invoice_layout/report/report_account_invoice_layout.rml +++ b/addons/account_invoice_layout/report/report_account_invoice_layout.rml @@ -297,7 +297,7 @@ - Note: [[ (a['note'] and format(a['note'])) or removeParentNode('tr') ]] + Note: [[ (a['note'] and format(a['note'] or '')) or removeParentNode('tr') ]] @@ -337,7 +337,7 @@ - [[ a['type']=='text' and format(a['name']) or removeParentNode('blockTable') ]] + [[ a['type']=='text' and format(a['name'] or '') or removeParentNode('blockTable') ]] [[ a['type']=='text' and '' ]] @@ -467,7 +467,7 @@ - [[ format(o.comment or removeParentNode('blockTable')) ]] + [[ format(o.comment or '') or removeParentNode('blockTable') ]] @@ -477,7 +477,7 @@ - [[ format((o.payment_term and o.payment_term.note) or removeParentNode('blockTable')) ]] + [[ format((o.payment_term and o.payment_term.note or '') or removeParentNode('blockTable')) ]] diff --git a/addons/account_invoice_layout/test/account_invoice_layout_report.yml b/addons/account_invoice_layout/test/account_invoice_layout_report.yml new file mode 100644 index 00000000000..b7b1c1e76cc --- /dev/null +++ b/addons/account_invoice_layout/test/account_invoice_layout_report.yml @@ -0,0 +1,17 @@ +- + 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')], {}, {}) + if tools.config['test_report_directory']: + file(os.path.join(tools.config['test_report_directory'], 'account_invoice_layout.'+format), 'wb+').write(data) +- + Print the Invoice Layout Report with Message in Normal mode +- + !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, {}) + 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