2010-10-19 11:14:23 +00:00
|
|
|
-
|
2010-12-11 12:52:29 +00:00
|
|
|
In order to test the PDF reports defined on an invoice, we will create a Invoice Record
|
2010-10-19 11:14:23 +00:00
|
|
|
-
|
|
|
|
!record {model: account.invoice, id: test_invoice_1}:
|
2010-12-11 12:52:29 +00:00
|
|
|
currency_id: base.EUR
|
2010-10-19 11:14:23 +00:00
|
|
|
company_id: base.main_company
|
2012-06-19 07:16:24 +00:00
|
|
|
partner_id: base.res_partner_1
|
2010-10-19 11:14:23 +00:00
|
|
|
state: draft
|
|
|
|
type: out_invoice
|
|
|
|
account_id: account.a_recv
|
|
|
|
name: Test invoice 1
|
2010-09-16 11:39:52 +00:00
|
|
|
-
|
2010-12-11 12:52:29 +00:00
|
|
|
In order to test the PDF reports defined using report_intrastat module, we print a Intrastat Report
|
2010-10-19 11:14:23 +00:00
|
|
|
-
|
2010-09-16 11:39:52 +00:00
|
|
|
!python {model: account.invoice}: |
|
2013-02-09 06:29:29 +00:00
|
|
|
import os
|
2013-02-22 13:35:11 +00:00
|
|
|
import openerp.report
|
|
|
|
from openerp import tools
|
2014-04-02 16:40:53 +00:00
|
|
|
data, format = openerp.report.render_report(cr, uid, [ref('test_invoice_1')], 'report_intrastat.report_intrastatinvoice', {}, {})
|
2010-09-16 11:39:52 +00:00
|
|
|
if tools.config['test_report_directory']:
|
2010-12-11 12:52:29 +00:00
|
|
|
file(os.path.join(tools.config['test_report_directory'], 'report_intrastat-intrastat_report.'+format), 'wb+').write(data)
|