l10n_ch: fix YML test, we need a valid report to print

bzr revid: odo@openerp.com-20110117222025-zsf2mrjac24j3ke6
This commit is contained in:
P. Christeas 2011-01-17 23:20:25 +01:00 committed by Olivier Dony
parent b89db99ede
commit 2735aa3721
1 changed files with 18 additions and 4 deletions

View File

@ -1,8 +1,22 @@
-
Creating a res.partner.bank record
-
!record {model: res.partner.bank, id: res_partner_bank_account0}:
acc_number: 001-1001-1291-12323
bank: base.res_bank_1
bvr_number: 01-101-12
name: Argolait Main Account
partner_id: base.res_partner_agrolait
sequence: 0.0
state: bvbank
-
In order to test the BVR report, I will assign a bank to the invoice
-
!record {model: account.invoice, id: account.test_invoice_1}:
partner_bank_id: res_partner_bank_account0
-
In order to test the PDF reports defined on a l10n_ch, we will print BVR Report
-
!python {model: account.invoice}: |
import netsvc, tools, os
(data, format) = netsvc.LocalService('webkitaccount.invoice_bvr').create(cr, uid, [ref('account.test_invoice_1')], {}, {})
if tools.config['test_report_directory']:
file(os.path.join(tools.config['test_report_directory'], 'l10ch-bvr_report.'+format), 'wb+').write(data)
from tools.test_reports import try_report
try_report(cr, uid, 'report.invoice_web_bvr', [ref('account.test_invoice_1')])