2 In order to test hr module in OpenERP, I will create new Employee , Department and Job Position.
4 I create "R&D Department" in Department form.
6 !record {model: hr.department, id: hr_department_rd0}:
7 manager_id: base.user_root
10 Now, I create a new employee “Mark Johnson”, and select department as "R&D Department".
12 !record {model: hr.employee, id: hr_employee_mark}:
13 address_home_id: base.res_partner_address_1
14 company_id: base.main_company
18 user_id: base.user_root
20 I assign department for employee 'Mark Johnson'
22 !python {model: hr.employee}: |
23 res = self.onchange_department_id(cr, uid, ref('hr_employee_mark'), ref('hr_department_rd0'), None)
24 assert res['value']['parent_id']
26 In order to check the wizard “Employee Hierarchy” , I will create new employee “Phil Graves ” and select "Mark Johnson" as
29 !record {model: hr.employee, id: hr_employee_phil}:
30 address_home_id: base.res_partner_address_3000
31 company_id: base.main_company
34 user_id: base.user_demo
35 parent_id: 'hr_employee_mark'
37 I fill the Working address for Employee
39 !python {model: hr.employee}: |
40 res = self.onchange_address_id(cr, uid, ref('hr_employee_phil'), ref('base.res_partner_address_3000'), None)
43 I will open up form view of “Mark Johnson” and test the wizard “Employee Hierarchy” so it display the employee
44 hierarchy starting from “Mark Johnson”.
47 I will create new Job Position. I will check successfull creation of new Job Position by adding the information.
49 !record {model: hr.job, id: hr_job_jea0}:
50 department_id: 'hr_department_rd0'
51 description: 'Position of Junior Application Engineer'
55 I check that Employee form is in "Open" state.
57 !assert {model: hr.job, id: hr_job_jea0}:
61 I create Employee for job position.
63 !record {model: hr.job, id: hr_job_jea0}:
65 - address_home_id: base.res_partner_address_1
67 department_id: 'hr_department_rd0'
69 parent_id: 'hr_employee_mark'
71 I check that "Number of Employees" field have some value.
73 !assert {model: hr.job, id: hr_job_jea0}:
74 - no_of_employee != False