- In order to test Payment Advice I create a new Payment Advice - I create a new Payment Advice with NEFT Transaction Enable - !record {model: hr.payroll.advice, id: payment_advice_1}: name: 'NEFT Advice' bank_id: base.res_bank_1 line_ids: - employee_id: hr.employee_fp name: '90125452552' ifsc_code: 'abn45215145' bysal: 25000.00 - employee_id: hr.employee_al name: '00014521111232' ifsc_code: 'sbi45452145' bysal: 20000.00 - I check that the Payment Advice is in "Draft" - !assert {model: hr.payroll.advice, id: payment_advice_1}: - state == 'draft' - Now I confirm Payment Advice - !python {model: hr.payroll.advice}: | self.confirm_sheet(cr, uid, [ref('payment_advice_1')]) - I check that the Payment Advice state is "Confirmed" - !python {model: hr.payroll.advice}: | advice = self.browse(cr, uid, ref("payment_advice_1")) assert (advice.state == 'confirm') - In order to test the PDF report defined on a Payment Advice, we will print a Print Advice Report when NEFT is checked - !python {model: hr.payroll.advice}: | import os import openerp.report from openerp import tools data, format = openerp.report.render_report(cr, uid, [ref('payment_advice_1')], 'l10n_in_hr_payroll.report_payrolladvice', {}, {}) if tools.config['test_report_directory']: file(os.path.join(tools.config['test_report_directory'], 'l10n_in_hr_payroll_summary_report.'+format), 'wb+').write(data)