[IMP] More explicit; where is the Edit button
[odoo/odoo.git] / addons / l10n_in_hr_payroll / test / payment_advice.yml
1 -
2   In order to test Payment Advice I create a new Payment Advice 
3 -
4   I create a new Payment Advice with NEFT Transaction Enable
5 -
6   !record {model: hr.payroll.advice, id: payment_advice_1}: 
7     name: 'NEFT Advice'
8     bank_id: base.res_bank_1
9     line_ids:
10       - employee_id: hr.employee_fp
11         name: '90125452552'
12         ifsc_code: 'abn45215145'
13         bysal: 25000.00
14       - employee_id: hr.employee_al
15         name: '00014521111232'
16         ifsc_code: 'sbi45452145'
17         bysal: 20000.00 
18 -
19   I check that the Payment Advice is in "Draft"
20 -
21   !assert {model: hr.payroll.advice, id: payment_advice_1}:
22     - state == 'draft'
23 -
24   Now I confirm Payment Advice
25 -    
26   !python {model: hr.payroll.advice}: |
27     self.confirm_sheet(cr, uid, [ref('payment_advice_1')])
28 -
29   I check that the Payment Advice state is "Confirmed"
30 -
31   !python {model: hr.payroll.advice}: |
32     advice = self.browse(cr, uid, ref("payment_advice_1"))
33     assert (advice.state == 'confirm')
34 -
35   In order to test the PDF report defined on a Payment Advice, we will print a Print Advice Report when NEFT is checked
36 -
37   !python {model: hr.payroll.advice}: |
38     import os
39     import openerp.report
40     from openerp import tools
41     data, format = openerp.report.render_report(cr, uid, [ref('l10n_in_hr_payroll.payment_advice_1')], 'payroll.advice', {}, {})
42     if tools.config['test_report_directory']:
43         file(os.path.join(tools.config['test_report_directory'], 'l10n_in_hr_payroll_summary report'+format), 'wb+').write(data)