diff --git a/addons/l10n_in_hr_payroll/__openerp__.py b/addons/l10n_in_hr_payroll/__openerp__.py index 9f51abe939e..9fb18e0b887 100644 --- a/addons/l10n_in_hr_payroll/__openerp__.py +++ b/addons/l10n_in_hr_payroll/__openerp__.py @@ -54,6 +54,10 @@ Indian Payroll Salary Rules. 'report/payment_advice_report_view.xml', ], + 'test': [ + 'test/payment_advice.yml', + ], + 'demo_xml': ['l10n_in_hr_payroll_demo.xml'], 'installable': True } diff --git a/addons/l10n_in_hr_payroll/test/payment_advice.yml b/addons/l10n_in_hr_payroll/test/payment_advice.yml new file mode 100644 index 00000000000..20b45830c5e --- /dev/null +++ b/addons/l10n_in_hr_payroll/test/payment_advice.yml @@ -0,0 +1,41 @@ +- + 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 netsvc, tools, os + (data, format) = netsvc.LocalService('report.payroll.advice').create(cr, uid, [ref('l10n_in_hr_payroll.payment_advice_1')], {}) + 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) \ No newline at end of file