[FIX] account_invoice_layout : YML test for report added

bzr revid: ach@tinyerp.com-20100916143048-p91ljsi6gklyb5xe
This commit is contained in:
Anup (OpenERP) 2010-09-16 20:00:48 +05:30
parent e4479ffd6a
commit 12d4d294d9
4 changed files with 37 additions and 5 deletions

View File

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

View File

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data noupdate="1">
<record id="demo_message1" model="notify.message">
<field name="name">OpenERP SA</field>
<field name="msg">ERP & CRM Solutions....</field>
</record>
<record id="demo_message1" model="notify.message">
<field name="name">Tiny sprl</field>
<field name="msg">Be Expert with the Experts...</field>
</record>
</data>
</openerp>

View File

@ -297,7 +297,7 @@
</para>
</td>
<td>
<para style="terp_default_Note">Note: [[ (a['note'] and format(a['note'])) or removeParentNode('tr') ]]</para>
<para style="terp_default_Note">Note: [[ (a['note'] and format(a['note'] or '')) or removeParentNode('tr') ]]</para>
<para style="terp_default_Note">
<font color="white"> </font>
</para>
@ -337,7 +337,7 @@
</para>
</td>
<td>
<para style="terp_default_9">[[ a['type']=='text' and format(a['name']) or removeParentNode('blockTable') ]]</para>
<para style="terp_default_9">[[ a['type']=='text' and format(a['name'] or '') or removeParentNode('blockTable') ]]</para>
</td>
<td>
<para style="terp_default_9">[[ a['type']=='text' and '' ]]</para>
@ -467,7 +467,7 @@
<blockTable colWidths="539.0" style="Table_Coment_Payment_Term">
<tr>
<td>
<para style="terp_default_9">[[ format(o.comment or removeParentNode('blockTable')) ]]</para>
<para style="terp_default_9">[[ format(o.comment or '') or removeParentNode('blockTable') ]]</para>
</td>
</tr>
</blockTable>
@ -477,7 +477,7 @@
<blockTable colWidths="539.0" style="Table_Payment_Terms">
<tr>
<td>
<para style="terp_default_9">[[ format((o.payment_term and o.payment_term.note) or removeParentNode('blockTable')) ]]</para>
<para style="terp_default_9">[[ format((o.payment_term and o.payment_term.note or '') or removeParentNode('blockTable')) ]]</para>
</td>
</tr>
</blockTable>

View File

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