odoo/addons/l10n_ch/test/l10n_ch_report.yml

60 lines
1.8 KiB
YAML

-
In order to test BVR printing. I create Partner data .
-
!record {model: res.partner.category, id: res_partner_category_bvr}:
name: Customers
-
I create BVR DUMMY Customer.
-
!record {model: res.partner, id: res_partner_bvr}:
category_id:
- res_partner_category_bvr
name: BVR DUMMY
-
I create contact address for BVR DUMMY.
-
!record {model: res.partner.address, id: res_partner_address_1}:
partner_id: res_partner_bvr
street: Route de Bélario
type: contact
-
I create invoice address for BVR DUMMY.
-
!record {model: res.partner.address, id: res_partner_address_2}:
partner_id: res_partner_bvr
street: Route de Bélario
type: invoice
-
I create delivery address for BVR DUMMY.
-
!record {model: res.partner.address, id: res_partner_address_3}:
partner_id: res_partner_bvr
street: Route de Bélario
type: delivery
-
In order to test the PDF BVR webkit reports defined on an invoice, we will create a Invoice Record
-
!record {model: account.invoice, id: l10n_ch_invoice}:
currency_id: base.CHF
company_id: base.main_company
address_invoice_id: res_partner_address_2
partner_id: res_partner_bvr
state: draft
type: out_invoice
account_id: account.a_recv
name: BVR test invoice
address_contact_id: res_partner_address_1
-
In order to test the BVR report, I will assign a bank to the invoice
-
!record {model: account.invoice, id: l10n_ch_invoice}:
partner_bank_id: main_partner_bank
-
In order to test the PDF reports defined on a l10n_ch, we will print BVR Report
-
!python {model: account.invoice}: |
from tools.test_reports import try_report
company = self.pool.get('res.users').browse(cr, uid, uid).company_id
company.lib_path and try_report(cr, uid, 'report.invoice_web_bvr', [ref('l10n_ch_invoice')]) or 'Webkit lib not set'