odoo/addons/report_intrastat/test/report_intrastat_report.yml

22 lines
864 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 os
import openerp.report
from openerp import tools
data, format = openerp.report.render_report(cr, uid, [ref('test_invoice_1')], 'report_intrastat.report_intrastatinvoice', {}, {})
if tools.config['test_report_directory']:
file(os.path.join(tools.config['test_report_directory'], 'report_intrastat-intrastat_report.'+format), 'wb+').write(data)