2 In order to test hr_evaluation module for OpenERP, I will create plan then create evaluation under that plan.
5 I create new Department.
7 !record {model: hr.department, id: hr_department_rd0}:
8 manager_id: base.user_root
11 I create a new employee.
13 !record {model: hr.employee, id: hr_employee_employee0}:
14 address_home_id: base.res_partner_address_1
15 company_id: base.main_company
19 user_id: base.user_root
20 department_id: 'hr_department_rd0'
22 I create another new employee and assign first one as it's Manager.
24 !record {model: hr.employee, id: hr_employee_employee1}:
25 address_home_id: base.res_partner_address_3000
26 company_id: base.main_company
29 user_id: base.user_demo
30 parent_id: 'hr_employee_employee0'
33 I Create an "Employee Evaluation" survey for Manager's Evaluation Plan.
35 !record {model: 'survey', id: survey_0}:
36 title: 'Employee Evaluation'
37 max_response_limit: 20
40 I Create an "Employee Evaluation" page in "Employee Evaluation" survey.
42 !record {model: 'survey.page', id: survey_employee_page_0}:
43 title: 'Employee Evaluation'
46 I Create "What is your Name" question in "Employee Evaluation" survey page.
48 !record {model: 'survey.question', id: survey_p_question_0}:
49 question: 'What is your Name?'
50 type: 'single_textbox'
52 page_id: survey_employee_page_0
54 I Create "What is your gender" Question in "Employee Evaluation" survey page.
56 !record {model: 'survey.question', id: survey_p_question_1}:
57 question: 'What is your gender?'
58 type: multiple_choice_only_one_ans
60 is_require_answer: true
61 page_id: survey_employee_page_0
63 I Create "Male" answer in question "What is your gender?"
65 !record {model: 'survey.answer', id: survey_p_1_1}:
68 question_id : survey_p_question_1
70 I Create "Female" answer in question "What is your gender?"
72 !record {model: 'survey.answer', id: survey_p_1_2}:
75 question_id : survey_p_question_1
78 I set the survey in open state.
80 !python {model: survey}: |
81 self.survey_open(cr, uid, [ref("survey_0")], context)
84 I create an Evaluation plan and select "Employee Evaluation" survey for "Send to Subordinates" and "Final interview with Manager" Phase.
86 !record {model: hr_evaluation.plan, id: hr_evaluation_plan_managersplan0}:
87 company_id: base.main_company
93 name: Send to Subordinates
96 name: Final Interview with manager
100 I assign the evaluation plan to the employee "Mark Johnson".
102 !python {model: hr.employee}: |
103 res = self.onchange_evaluation_plan_id(cr, uid, [ref('hr_employee_employee0')], ref('hr_evaluation_plan_managersplan0'), False, None)
105 I create an Evaluation for employee under "Manager Evaluation Plan".
107 !record {model: hr_evaluation.evaluation, id: hr_evaluation_evaluation_0}:
108 date: !eval time.strftime('%Y-%m-%d')
109 employee_id: 'hr_employee_employee1'
110 plan_id: 'hr_evaluation_plan_managersplan0'
114 I change the employee on Evaluation.
116 !python {model: hr_evaluation.evaluation}: |
117 self.onchange_employee_id(cr, uid, [ref('hr_evaluation_evaluation_0')], ref('hr_employee_employee0'), None)
119 I start the evaluation process by click on "Start Evaluation" button.
121 !python {model: hr_evaluation.evaluation}: |
122 self.button_plan_in_progress(cr, uid, [ref('hr_evaluation_evaluation_0')])
124 I find a mistake on evaluation form. So I cancel the evaluation and again start it.
126 !python {model: hr_evaluation.evaluation}: |
127 self.button_cancel(cr, uid, [ref('hr_evaluation_evaluation_0')])
128 self.button_draft(cr, uid, [ref('hr_evaluation_evaluation_0')])
129 self.button_plan_in_progress(cr, uid, [ref('hr_evaluation_evaluation_0')])
131 I close this survey request by giving answer of survey question.
133 !python {model: hr_evaluation.evaluation}: |
134 evaluation = self.browse(cr, uid, ref('hr_evaluation_evaluation_0'))
135 self.pool.get('hr.evaluation.interview').survey_req_done(cr, uid, [r.id for r in evaluation.survey_request_ids])
139 !python {model: hr_evaluation.evaluation}: |
140 evaluation = self.browse(cr, uid, ref('hr_evaluation_evaluation_0'))
141 self.pool.get('hr.evaluation.interview').action_print_survey(cr, uid, [r.id for r in evaluation.survey_request_ids])
143 I click on "Final Validation" button to finalise evaluation.
145 !python {model: hr_evaluation.evaluation}: |
146 self.button_final_validation(cr, uid, [ref("hr_evaluation.hr_evaluation_evaluation_0")],
147 {"active_ids": [ref("hr_evaluation.menu_open_view_hr_evaluation_tree")]})
150 I check that state is "Final Validation".
152 !assert {model: hr_evaluation.evaluation, id: hr_evaluation_evaluation_0}:
153 - state == 'progress'
155 Give Rating "Meet expectations" by selecting overall Rating.
157 !record {model: hr_evaluation.evaluation, id: hr_evaluation.hr_evaluation_evaluation_0}:
161 I close this Evaluation by click on "Done" button of this wizard.
163 !python {model: hr_evaluation.evaluation}: |
164 self.button_done(cr, uid, [ref("hr_evaluation.hr_evaluation_evaluation_0")], {"active_ids": [ref("hr_evaluation.menu_open_view_hr_evaluation_tree")]})