20 lines
815 B
YAML
20 lines
815 B
YAML
-
|
|
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
|
|
partner_id: base.res_partner_1
|
|
state: draft
|
|
type: out_invoice
|
|
account_id: account.a_recv
|
|
name: Test invoice 1
|
|
-
|
|
In order to test the PDF reports defined using report_intrastat module, we print a Intrastat Report
|
|
-
|
|
!python {model: account.invoice}: |
|
|
import netsvc, tools, os
|
|
(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_intrastat-intrastat_report.'+format), 'wb+').write(data)
|