2 I set the "Employee Evaluation" survey in open state.
4 !python {model: survey}: |
5 self.survey_open(cr, uid, [ref("survey_2")], context)
7 I check that state of "Employee Evaluation" survey is Open.
9 !assert {model: survey, id: survey_2, severity: error, string: Survey should be in OPen state}:
12 I start the evaluation process by click on "Start Evaluation" button.
14 !python {model: hr_evaluation.evaluation}: |
15 self.button_plan_in_progress(cr, uid, [ref('hr_evaluation_evaluation_0')])
17 I check that state is "Plan in progress".
19 !assert {model: hr_evaluation.evaluation, id: hr_evaluation_evaluation_0, severity: error, string: Evaluation should be 'Plan in progress' state}:
22 I find a mistake on evaluation form. So I cancel the evaluation and again start it.
24 !python {model: hr_evaluation.evaluation}: |
25 evaluation = self.browse(cr, uid, ref('hr_evaluation_evaluation_0') , context)
26 self.button_cancel(cr, uid, [ref('hr_evaluation_evaluation_0')])
27 assert evaluation.state == 'cancel', 'Evaluation should be in cancel state'
28 self.button_draft(cr, uid, [ref('hr_evaluation_evaluation_0')])
29 evaluation = self.browse(cr, uid, ref('hr_evaluation_evaluation_0') , context)
30 assert evaluation.state == 'draft', 'Evaluation should be in draft state'
31 self.button_plan_in_progress(cr, uid, [ref('hr_evaluation_evaluation_0')])
33 I check that state is "Plan in progress" and "Interview Request" record is created
35 !python {model: hr_evaluation.evaluation}: |
36 interview_obj = self.pool.get('hr.evaluation.interview')
37 evaluation = self.browse(cr, uid, ref('hr_evaluation_evaluation_0') , context)
38 assert evaluation.state == 'wait', "Evaluation should be 'Plan in progress' state"
39 interview_ids = interview_obj.search(cr, uid, [('evaluation_id','=', ref('hr_evaluation_evaluation_0'))])
40 assert len(interview_ids), "Interview evaluation survey not created"
42 Give answer of the first page in "Employee Evaluation" survey.
44 !python {model: survey.question.wiz}: |
45 name_wiz_obj=self.pool.get('survey.name.wiz')
46 interview_obj = self.pool.get('hr.evaluation.interview')
47 interview_ids = interview_obj.search(cr, uid, [('evaluation_id','=', ref('hr_evaluation_evaluation_0'))])
48 assert len(interview_ids), "Interview evaluation survey not created"
49 ctx = {'active_model':'hr.evaluation.interview', 'active_id': interview_ids[0], 'active_ids': [interview_ids], 'survey_id': ref("survey_2")}
50 name_id = name_wiz_obj.create(cr, uid, {'survey_id': ref("survey_2")})
51 ctx ["sur_name_id"] = name_id
52 self.create(cr, uid, {str(ref("survey_question_2")) +"_" +str(ref("survey_answer_1")) + "_multi" :'tpa',
53 str(ref("survey_question_2")) +"_" +str(ref("survey_answer_10")) + "_multi" :'application eng',
54 str(ref("survey_question_2")) +"_" +str(ref("survey_answer_20")) + "_multi" :'3',
55 str(ref("survey_question_2")) +"_" +str(ref("survey_answer_25")) + "_multi" :'2011-12-02 16:42:00',
56 str(ref("survey_question_2")) +"_" +str(ref("survey_answer_43")) + "_multi" :'HR',
57 str(ref("survey_question_2")) +"_" +str(ref("survey_answer_98")) + "_multi" :'tpa review'
60 I close this Evaluation survey by giving answer of questions.
62 !python {model: hr_evaluation.evaluation}: |
63 interview_obj = self.pool.get('hr.evaluation.interview')
64 evaluation = self.browse(cr, uid, ref('hr_evaluation_evaluation_0'))
65 interview_obj.survey_req_done(cr, uid, [r.id for r in evaluation.survey_request_ids])
66 for survey in evaluation.survey_request_ids:
67 interview = interview_obj.browse(cr, uid, survey.id, context)
68 assert interview.state == "done", 'survey must be in done state'
70 I print the evaluation.
72 !python {model: hr_evaluation.evaluation}: |
73 evaluation = self.browse(cr, uid, ref('hr_evaluation_evaluation_0'))
74 self.pool.get('hr.evaluation.interview').action_print_survey(cr, uid, [r.id for r in evaluation.survey_request_ids])
76 I click on "Final Validation" button to finalise evaluation.
78 !python {model: hr_evaluation.evaluation}: |
79 self.button_final_validation(cr, uid, [ref("hr_evaluation_evaluation_0")])
81 I check that state is "Waiting Appreciation".
83 !assert {model: hr_evaluation.evaluation, id: hr_evaluation_evaluation_0}:
86 Give Rating "Meet expectations" by selecting overall Rating.
88 !record {model: hr_evaluation.evaluation, id: hr_evaluation_evaluation_0}:
91 I close this Evaluation by click on "Done" button of this wizard.
93 !python {model: hr_evaluation.evaluation}: |
94 self.button_done(cr, uid, [ref("hr_evaluation_evaluation_0")])
96 I check that state of Evaluation is done.
98 !assert {model: hr_evaluation.evaluation, id: hr_evaluation_evaluation_0, severity: error, string: Evaluation should be in done state}:
101 Print Evaluations Statistics Report
103 !python {model: hr.evaluation.report}: |
104 import netsvc, tools, os, time
106 data_dict={'state': 'done', 'rating': 2, 'employee_id': ref("hr.employee_fp")}
107 from tools import test_reports
108 test_reports.try_report_action(cr, uid, 'hr_evaluation_evaluation_0',wiz_data=data_dict, context=ctx, our_module='hr_evaluation')