[MERGE]
[odoo/odoo.git] / addons / l10n_ch / test / l10n_ch_report.yml
1 -
2   In order to test the PDF reports defined on a l10n_ch, we will create a invoice record
3 -
4   !record {model: account.invoice, id: test_invoice_1}:
5         currency_id: base.EUR
6         company_id: base.main_company
7         address_invoice_id: base.res_partner_address_tang
8         partner_id: base.res_partner_asus
9         state: draft
10         type: out_invoice
11         account_id: account.a_recv
12         name: Test invoice 1
13         address_contact_id: base.res_partner_address_tang
14 -
15   In order to test the PDF reports defined on a l10n_ch, we will print BVR Report
16 -
17   !python {model: account.invoice}: |
18     import netsvc, tools, os
19     run_str = 'cp ' + tools.config['addons_path'] + '/l10n_ch/report/ocrbb.ttf' + ' ' + '/tmp/ocrbb.ttf'
20     os.system(run_str)
21     (data, format) = netsvc.LocalService('report.l10n_ch.bvr').create(cr, uid, [ref('test_invoice_1')], {}, {})
22     if tools.config['test_report_directory']:
23         file(os.path.join(tools.config['test_report_directory'], 'l10ch-bvr_report.'+format), 'wb+').write(data)
24
25 -
26   In order to test the PDF reports defined on a l10n_ch, we will print a BVR Invoice Report
27 -
28   !python {model: account.invoice}: |
29     import netsvc, tools, os
30     (data, format) = netsvc.LocalService('report.l10n_ch.invoice.bvr').create(cr, uid, [ref('test_invoice_1')], {}, {})
31     if tools.config['test_report_directory']:
32         file(os.path.join(tools.config['test_report_directory'], 'l10ch-bvr_invoice_report.'+format), 'wb+').write(data)