[FIX] of BVR unit Test

bzr revid: nicolas.bessi@camptocamp.com-20110217091452-q99ja9h39dvs1fwq
This commit is contained in:
nicolas.bessi@camptocamp.com 2011-02-17 10:14:52 +01:00
parent 23eb73937a
commit 32616b90a6
1 changed files with 51 additions and 2 deletions

View File

@ -1,11 +1,60 @@
-
I Partner data to Test BVR printing.
-
!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: account.test_invoice_1}:
!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
try_report(cr, uid, 'report.invoice_web_bvr', [ref('account.test_invoice_1')])
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'