[FIX] of BVR unit Test
authornicolas.bessi@camptocamp.com <>
Thu, 17 Feb 2011 09:14:52 +0000 (10:14 +0100)
committernicolas.bessi@camptocamp.com <>
Thu, 17 Feb 2011 09:14:52 +0000 (10:14 +0100)
bzr revid: nicolas.bessi@camptocamp.com-20110217091452-q99ja9h39dvs1fwq

addons/l10n_ch/test/l10n_ch_report.yml

index 7817f78..497b02c 100644 (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\8elario
+    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\8elario
+    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\8elario
+    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')])
\ No newline at end of file
+    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'
\ No newline at end of file