account_invoice_layout: remove duplicate demo data, write a report test

Nothing to do with production usage, but let us test the "test_reports"
API using this case of "active_id" + wizard_data report.

bzr revid: p_christ@hol.gr-20101227084158-4q8bawl8k4jjtbam
This commit is contained in:
P. Christeas 2010-12-27 10:41:58 +02:00
parent 61d64a1fc0
commit 7134f0c800
2 changed files with 13 additions and 6 deletions

View File

@ -4,11 +4,7 @@
<record id="demo_message1" model="notify.message">
<field name="name">OpenERP SA</field>
<field name="msg">ERP &amp; 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>
<field name="msg">ERP &amp; CRM Solutions...</field>
</record>
</data>
</openerp>

View File

@ -27,4 +27,15 @@
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)
file(os.path.join(tools.config['test_report_directory'], 'account_invoice_layout_message_report.'+format), 'wb+').write(data)
-
I will try to print the Invoice Layout Report with Message, through the wizard.
-
!python {model: res.partner}: |
from tools import test_reports
data = { 'message': ref('account_invoice_layout.demo_message1') }
ctx = { 'model': 'account.invoice',
'active_ids': [ ref('test_invoice_1'), ]
}
test_reports.try_report_action(cr, uid, 'action_account_invoice_special_msg',
wiz_data=data, context=ctx, our_module='account_invoice_layout')