diff --git a/addons/hr_payroll/hr_payroll_demo.xml b/addons/hr_payroll/hr_payroll_demo.xml index 9c2ce90cd7a..0d5b593279e 100644 --- a/addons/hr_payroll/hr_payroll_demo.xml +++ b/addons/hr_payroll/hr_payroll_demo.xml @@ -72,6 +72,7 @@ First Contract + This is a First Contract diff --git a/addons/hr_payroll/test/hr_payroll_report.yml b/addons/hr_payroll/test/hr_payroll_report.yml index e2268db7697..35020d30ceb 100644 --- a/addons/hr_payroll/test/hr_payroll_report.yml +++ b/addons/hr_payroll/test/hr_payroll_report.yml @@ -1,14 +1,14 @@ - - In order to test the PDF reports defined on HR Employee Salary, we will print HR Employee Salary + In order to test the PDF reports defined on HR Payroll, we will print Employees' Salary Structure - !python {model: hr.employee}: | import netsvc, tools, os (data, format) = netsvc.LocalService('report.salary.structure').create(cr, uid, [ref('hr_payroll.hr_employee_bonamy0')], {}, {}) if tools.config['test_report_directory']: - file(os.path.join(tools.config['test_report_directory'], 'hr_payroll-salary_report.'+format), 'wb+').write(data) - + file(os.path.join(tools.config['test_report_directory'], 'hr_payroll-salary_structure.'+format), 'wb+').write(data) + - - In order to test the PDF reports defined on HR Payslip, we will print a HR Payslip + Print HR Payslip - !python {model: hr.payslip}: | import netsvc, tools, os @@ -17,20 +17,23 @@ file(os.path.join(tools.config['test_report_directory'], 'hr_payroll-payslip_report.'+format), 'wb+').write(data) - - In order to test the PDF reports defined on HR Employee Salary Details, we will print HR Employee Salary Details + Print HR Employee Salary Details - !python {model: hr.payslip}: | import netsvc, tools, os, time - data_dict = {'model': 'ir.ui.menu', 'form': {'fiscalyear_id': ref('account.data_fiscalyear'), 'employee_ids': [ref('hr.employee2')]}} - (data, format) = netsvc.LocalService('report.employees.salary').create(cr, uid, [], data_dict, {'periods': []}) + emp_ids = [ref('hr.employee1'),ref('hr.employee2'),ref('hr.employee3'),ref('hr_payroll.hr_employee_bonamy0')] + data_dict = {'model': 'ir.ui.menu', 'form': {'fiscalyear_id': ref('account.data_fiscalyear'), 'employee_ids': emp_ids, 'ids':emp_ids }} + (data, format) = netsvc.LocalService('report.employees.salary').create(cr, uid, [], data_dict, {'active_ids': emp_ids}) if tools.config['test_report_directory']: - file(os.path.join(tools.config['test_report_directory'], 'hr_payroll-employee_salary_detai_report.'+format), 'wb+').write(data) + file(os.path.join(tools.config['test_report_directory'], 'hr_payroll-employee_salary_detail_report.'+format), 'wb+').write(data) - - In order to test the PDF reports defined on HR Employee Salary Details, we will print HR Employee Salary Details + Print HR Employee Salary Details Annual basis - !python {model: hr.payslip}: | import netsvc, tools, os, time - data_dict = {'model': 'ir.ui.menu', 'form': {'fiscalyear_id': ref('account.data_fiscalyear'), 'salary_on': 'current_month', 'employee_ids': [ref('hr.employee2')]}} - (data, format) = netsvc.LocalService('report.year.salary').create(cr, uid, [], data_dict, {'periods': []}) + emp_ids = [ref('hr.employee1'),ref('hr.employee2'),ref('hr.employee3'),ref('hr_payroll.hr_employee_bonamy0')] + data_dict = {'model': 'hr.payslip', 'form': {'fiscalyear_id': ref('account.data_fiscalyear'), 'salary_on': 'current_month', 'employee_ids': emp_ids, 'ids':emp_ids}} + (data, format) = netsvc.LocalService('report.year.salary').create(cr, uid, [], data_dict,{'active_ids': emp_ids} ) if tools.config['test_report_directory']: - file(os.path.join(tools.config['test_report_directory'], 'hr_payroll-employee_yearly_salary_detai_report.'+format), 'wb+').write(data) \ No newline at end of file + file(os.path.join(tools.config['test_report_directory'], 'hr_payroll-employee_yearly_salary_detail_report.'+format), 'wb+').write(data) + diff --git a/addons/hr_payroll/test/payment_advice.yml b/addons/hr_payroll/test/payment_advice.yml index a2a9c3d5dbe..934485109b6 100644 --- a/addons/hr_payroll/test/payment_advice.yml +++ b/addons/hr_payroll/test/payment_advice.yml @@ -52,3 +52,12 @@ from tools.translate import _ advice_id=self.browse(cr, uid, ref("hr_payroll_advice_advice0")) assert(advice_id.state == 'confirm'), _('State not changed!') + +- + Print Payroll Advice +- + !python {model: hr.payroll.advice}: | + import netsvc, tools, os + (data, format) = netsvc.LocalService('report.payroll.advice').create(cr, uid, [ref('hr_payroll_advice_advice0')], {}, {}) + if tools.config['test_report_directory']: + file(os.path.join(tools.config['test_report_directory'], 'hr_payroll-payroll-advice.'+format), 'wb+').write(data) diff --git a/addons/hr_payroll/test/payroll_register.yml b/addons/hr_payroll/test/payroll_register.yml index f5772602db4..6ce953c1d94 100644 --- a/addons/hr_payroll/test/payroll_register.yml +++ b/addons/hr_payroll/test/payroll_register.yml @@ -1,6 +1,5 @@ - I test the 'Payroll Register' in order to check the hr_payroll in OpenERP -- I create a new employee “Keith” - !record {model: hr.employee, id: hr_employee_keith0}: @@ -61,3 +60,12 @@ from tools.translate import _ reg_brw=self.browse(cr, uid, ref("hr_payroll_register_payroll0")) assert(reg_brw.state == 'hr_check'), _('State not changed!') + +- + Print HR Payroll Register +- + !python {model: hr.payroll.register}: | + import netsvc, tools, os + (data, format) = netsvc.LocalService('report.hr.payroll.register.sheet').create(cr, uid, [ref('hr_payroll_register_payroll0')], {}, {}) + if tools.config['test_report_directory']: + file(os.path.join(tools.config['test_report_directory'], 'hr_payroll-register_report.'+format), 'wb+').write(data)