[IMP] Changed all module categories, limited number of categories
[odoo/odoo.git] / addons / hr_payroll / test / hr_payroll_report.yml
1 -
2   In order to test the PDF reports defined on HR Payroll, we will print Employees' Salary Structure
3 -
4   !python {model: hr.employee}: |
5     import netsvc, tools, os
6     (data, format) = netsvc.LocalService('report.salary.structure').create(cr, uid, [ref('hr_payroll.hr_employee_bonamy0')], {}, {})
7     if tools.config['test_report_directory']:
8         file(os.path.join(tools.config['test_report_directory'], 'hr_payroll-salary_structure.'+format), 'wb+').write(data)
9
10 -
11   Print HR Payslip
12 -
13   !python {model: hr.payslip}: |
14     import netsvc, tools, os
15     (data, format) = netsvc.LocalService('report.payslip.pdf').create(cr, uid, [ref('hr_payroll.hr_payslip_salaryslipofbonamyforjune0')], {}, {})
16     if tools.config['test_report_directory']:
17         file(os.path.join(tools.config['test_report_directory'], 'hr_payroll-payslip_report.'+format), 'wb+').write(data)
18
19 -
20   Print Employee Salary Statement through wizard
21 -
22   !python {model: hr.payslip}: |
23     import time
24     ctx={}
25     ctx.update({'model': 'hr.employee','active_ids': [ref('hr.employee1'),ref('hr.employee2'),ref('hr.employee3'),ref('hr_payroll.hr_employee_bonamy0')]})
26     data_dict = {'employee_ids': [(6,0,[ref('hr.employee1'),ref('hr.employee2'),ref('hr.employee3'),ref('hr_payroll.hr_employee_bonamy0')])], 'date_from': time.strftime('%Y-01-01'), 'date_to': time.strftime('%Y-%m-%d')}
27     from tools import test_reports
28     test_reports.try_report_action(cr, uid, 'action_hr_payroll_employees_detail',wiz_data=data_dict, context=ctx, our_module='hr_payroll')
29
30 -
31   Print Salary Register through wizard
32 -
33   !python {model: hr.payslip}: |
34     import time
35     ctx={}
36     ctx.update({'model': 'hr.payslip','active_ids': [ref('hr.employee1'),ref('hr.employee2'),ref('hr.employee3'),ref('hr_payroll.hr_employee_bonamy0')]})
37     data_dict = {'employee_ids': [(6,0,[ref('hr.employee1'),ref('hr.employee2'),ref('hr.employee3'),ref('hr_payroll.hr_employee_bonamy0')])], 'date_from': time.strftime('%Y-01-01'), 'date_to': time.strftime('%Y-%m-%d')}
38     from tools import test_reports
39     test_reports.try_report_action(cr, uid, 'action_hr_payroll_year_salary',wiz_data=data_dict, context=ctx, our_module='hr_payroll')
40
41