From cfdc867c09a8aa81803ccffe66b40f320ee14e34 Mon Sep 17 00:00:00 2001 From: "Turkesh Patel (Open ERP)" Date: Mon, 28 Nov 2011 15:03:54 +0530 Subject: [PATCH 1/5] [IMP] clean YML and added file hr_evalution_demo.yml bzr revid: tpa@tinyerp.com-20111128093354-3zo4m4dznid0gyxw --- addons/hr_evaluation/__openerp__.py | 4 +- addons/hr_evaluation/hr_evaluation_demo.xml | 6 + .../hr_evaluation/test/hr_evalution_demo.yml | 6 + .../hr_evaluation/test/test_hr_evaluation.yml | 149 ++++-------------- 4 files changed, 43 insertions(+), 122 deletions(-) create mode 100644 addons/hr_evaluation/test/hr_evalution_demo.yml diff --git a/addons/hr_evaluation/__openerp__.py b/addons/hr_evaluation/__openerp__.py index 720c49302d4..9195b50969b 100644 --- a/addons/hr_evaluation/__openerp__.py +++ b/addons/hr_evaluation/__openerp__.py @@ -50,7 +50,9 @@ in the form of pdf file. Implements a dashboard for My Current Evaluations 'hr_evaluation_data.xml', 'hr_evaluation_installer.xml', ], - "test": ["test/test_hr_evaluation.yml"], + "test": ["test/test_hr_evaluation.yml", + "test/hr_evalution_demo.yml" + ], "active": False, "installable": True, "certificate" : "00883207679172998429", diff --git a/addons/hr_evaluation/hr_evaluation_demo.xml b/addons/hr_evaluation/hr_evaluation_demo.xml index db096f13266..6fc31170396 100644 --- a/addons/hr_evaluation/hr_evaluation_demo.xml +++ b/addons/hr_evaluation/hr_evaluation_demo.xml @@ -14,5 +14,11 @@ + + 2011-12-24 + + + + \ No newline at end of file diff --git a/addons/hr_evaluation/test/hr_evalution_demo.yml b/addons/hr_evaluation/test/hr_evalution_demo.yml new file mode 100644 index 00000000000..817be623901 --- /dev/null +++ b/addons/hr_evaluation/test/hr_evalution_demo.yml @@ -0,0 +1,6 @@ +- + !record {model: hr.employee, id: hr.employee1, view: False}: + evaluation_plan_id: hr_evaluation_plan_managersevaluationplan0 +- + !record {model: hr_evaluation.evaluation, id: hr_evaluation_evaluation_0, view: False}: + plan_id: hr_evaluation.hr_evaluation_plan_managersevaluationplan0 \ No newline at end of file diff --git a/addons/hr_evaluation/test/test_hr_evaluation.yml b/addons/hr_evaluation/test/test_hr_evaluation.yml index 893f19d0a3e..1acb5c80878 100644 --- a/addons/hr_evaluation/test/test_hr_evaluation.yml +++ b/addons/hr_evaluation/test/test_hr_evaluation.yml @@ -1,129 +1,25 @@ - - In order to test hr_evaluation module for OpenERP, I will create plan then create evaluation under that plan. -- - - I create new Department. -- - !record {model: hr.department, id: hr_department_rd0}: - manager_id: base.user_root - name: 'R & D' -- - I create a new employee. -- - !record {model: hr.employee, id: hr_employee_employee0}: - address_home_id: base.res_partner_address_1 - company_id: base.main_company - gender: male - marital: single - name: Mark Johnson - user_id: base.user_root - department_id: 'hr_department_rd0' -- - I create another new employee and assign first one as it's Manager. -- - !record {model: hr.employee, id: hr_employee_employee1}: - address_home_id: base.res_partner_address_3000 - company_id: base.main_company - gender: male - name: Phil Graves - user_id: base.user_demo - parent_id: 'hr_employee_employee0' - -- - I Create an "Employee Evaluation" survey for Manager's Evaluation Plan. -- - !record {model: 'survey', id: survey_0}: - title: 'Employee Evaluation' - max_response_limit: 20 - response_user: 2 -- - I Create an "Employee Evaluation" page in "Employee Evaluation" survey. -- - !record {model: 'survey.page', id: survey_employee_page_0}: - title: 'Employee Evaluation' - survey_id: survey_0 -- - I Create "What is your Name" question in "Employee Evaluation" survey page. -- - !record {model: 'survey.question', id: survey_p_question_0}: - question: 'What is your Name?' - type: 'single_textbox' - sequence: 1 - page_id: survey_employee_page_0 -- - I Create "What is your gender" Question in "Employee Evaluation" survey page. -- - !record {model: 'survey.question', id: survey_p_question_1}: - question: 'What is your gender?' - type: multiple_choice_only_one_ans - sequence: 2 - is_require_answer: true - page_id: survey_employee_page_0 -- - I Create "Male" answer in question "What is your gender?" -- - !record {model: 'survey.answer', id: survey_p_1_1}: - answer: 'Male' - sequence: 1 - question_id : survey_p_question_1 -- - I Create "Female" answer in question "What is your gender?" -- - !record {model: 'survey.answer', id: survey_p_1_2}: - answer: 'Female' - sequence: 2 - question_id : survey_p_question_1 - + In order to test hr evaluation plan. - I set the survey in open state. - !python {model: survey}: | - self.survey_open(cr, uid, [ref("survey_0")], context) - + self.survey_open(cr, uid, [ref("survey_2")], context) - - I create an Evaluation plan and select "Employee Evaluation" survey for "Send to Subordinates" and "Final interview with Manager" Phase. + I check that state of survey is Open. - - !record {model: hr_evaluation.plan, id: hr_evaluation_plan_managersplan0}: - company_id: base.main_company - month_first: 3 - month_next: 6 - name: Manager's Plan - phase_ids: - - action: bottom-up - name: Send to Subordinates - survey_id: 'survey_0' - - action: top-down - name: Final Interview with manager - sequence: 2 - survey_id: 'survey_0' -- - I assign the evaluation plan to the employee "Mark Johnson". -- - !python {model: hr.employee}: | - res = self.onchange_evaluation_plan_id(cr, uid, [ref('hr_employee_employee0')], ref('hr_evaluation_plan_managersplan0'), False, None) - values = dict([('evaluation_plan_id', ref('hr_evaluation_plan_managersplan0'))] + res['value'].items()) - self.write(cr, uid, [ref('hr_employee_employee0')], values, None) -- - I create an Evaluation for employee under "Manager Evaluation Plan". -- - !record {model: hr_evaluation.evaluation, id: hr_evaluation_evaluation_0}: - date: !eval time.strftime('%Y-%m-%d') - employee_id: 'hr_employee_employee1' - plan_id: 'hr_evaluation_plan_managersplan0' - progress: 0.0 - state: draft -- - I change the employee on Evaluation. -- - !python {model: hr_evaluation.evaluation}: | - res = self.onchange_employee_id(cr, uid, [ref('hr_evaluation_evaluation_0')], ref('hr_employee_employee0'), None) - values = dict([('employee_id', ref('hr_employee_employee0'))] + res['value'].items()) - self.write(cr, uid, [ref('hr_evaluation_evaluation_0')], values, None) + !assert {model: survey, id: survey_2, severity: error, string: Survey should be in OPen state}: + - state == 'open' - I start the evaluation process by click on "Start Evaluation" button. - !python {model: hr_evaluation.evaluation}: | self.button_plan_in_progress(cr, uid, [ref('hr_evaluation_evaluation_0')]) +- + I check that state is open. +- + !assert {model: hr_evaluation.evaluation, id: hr_evaluation_evaluation_0, severity: error, string: Evaluation should be in open state}: + - state == 'wait' - I find a mistake on evaluation form. So I cancel the evaluation and again start it. - @@ -131,12 +27,21 @@ self.button_cancel(cr, uid, [ref('hr_evaluation_evaluation_0')]) self.button_draft(cr, uid, [ref('hr_evaluation_evaluation_0')]) self.button_plan_in_progress(cr, uid, [ref('hr_evaluation_evaluation_0')]) +- + I check that state is open. +- + !assert {model: hr_evaluation.evaluation, id: hr_evaluation_evaluation_0, severity: error, string: Evaluation should be in open state}: + - state == 'wait' - I close this survey request by giving answer of survey question. - !python {model: hr_evaluation.evaluation}: | evaluation = self.browse(cr, uid, ref('hr_evaluation_evaluation_0')) - self.pool.get('hr.evaluation.interview').survey_req_done(cr, uid, [r.id for r in evaluation.survey_request_ids]) + interview_obj=self.pool.get('hr.evaluation.interview') + interview_obj.survey_req_done(cr, uid, [r.id for r in evaluation.survey_request_ids]) + for survey in evaluation.survey_request_ids: + interview = interview_obj.browse(cr, uid, survey.id, context) + assert interview.state == "done", 'survey must be in done state' - I print the survey. - @@ -147,9 +52,7 @@ I click on "Final Validation" button to finalise evaluation. - !python {model: hr_evaluation.evaluation}: | - self.button_final_validation(cr, uid, [ref("hr_evaluation.hr_evaluation_evaluation_0")], - {"active_ids": [ref("hr_evaluation.menu_open_view_hr_evaluation_tree")]}) - + self.button_final_validation(cr, uid, [ref("hr_evaluation_evaluation_0")]) - I check that state is "Final Validation". - @@ -158,11 +61,15 @@ - Give Rating "Meet expectations" by selecting overall Rating. - - !record {model: hr_evaluation.evaluation, id: hr_evaluation.hr_evaluation_evaluation_0}: + !record {model: hr_evaluation.evaluation, id: hr_evaluation_evaluation_0}: rating: '2' - - I close this Evaluation by click on "Done" button of this wizard. - !python {model: hr_evaluation.evaluation}: | - self.button_done(cr, uid, [ref("hr_evaluation.hr_evaluation_evaluation_0")], {"active_ids": [ref("hr_evaluation.menu_open_view_hr_evaluation_tree")]}) + self.button_done(cr, uid, [ref("hr_evaluation_evaluation_0")]) +- + I check that state of Evaluation is done. +- + !assert {model: hr_evaluation.evaluation, id: hr_evaluation_evaluation_0, severity: error, string: Evaluation should be in pending state}: + - state == 'done' \ No newline at end of file From 8bd419b7b4cb28b7bf69e7c37cfac59610011bf8 Mon Sep 17 00:00:00 2001 From: "Turkesh Patel (Open ERP)" Date: Fri, 2 Dec 2011 12:48:43 +0530 Subject: [PATCH 2/5] [IMP] give answers of que bzr revid: tpa@tinyerp.com-20111202071843-zmng1lv1fasfa95h --- .../hr_evaluation/test/test_hr_evaluation.yml | 61 +++++++++++++++---- 1 file changed, 48 insertions(+), 13 deletions(-) diff --git a/addons/hr_evaluation/test/test_hr_evaluation.yml b/addons/hr_evaluation/test/test_hr_evaluation.yml index 1acb5c80878..2ae3f6702f2 100644 --- a/addons/hr_evaluation/test/test_hr_evaluation.yml +++ b/addons/hr_evaluation/test/test_hr_evaluation.yml @@ -1,15 +1,13 @@ - - In order to test hr evaluation plan. -- - I set the survey in open state. + I set the "Employee Evaluation" in open state. - !python {model: survey}: | - self.survey_open(cr, uid, [ref("survey_2")], context) + self.survey_open(cr, uid, [ref("survey_2")], context) - - I check that state of survey is Open. + I check that state of "Employee Evaluation" is Open. - !assert {model: survey, id: survey_2, severity: error, string: Survey should be in OPen state}: - - state == 'open' + - state == 'open' - I start the evaluation process by click on "Start Evaluation" button. - @@ -19,21 +17,49 @@ I check that state is open. - !assert {model: hr_evaluation.evaluation, id: hr_evaluation_evaluation_0, severity: error, string: Evaluation should be in open state}: - - state == 'wait' + - state == 'wait' - I find a mistake on evaluation form. So I cancel the evaluation and again start it. - !python {model: hr_evaluation.evaluation}: | - self.button_cancel(cr, uid, [ref('hr_evaluation_evaluation_0')]) - self.button_draft(cr, uid, [ref('hr_evaluation_evaluation_0')]) - self.button_plan_in_progress(cr, uid, [ref('hr_evaluation_evaluation_0')]) + self.button_cancel(cr, uid, [ref('hr_evaluation_evaluation_0')]) + self.button_draft(cr, uid, [ref('hr_evaluation_evaluation_0')]) + self.button_plan_in_progress(cr, uid, [ref('hr_evaluation_evaluation_0')]) - I check that state is open. - !assert {model: hr_evaluation.evaluation, id: hr_evaluation_evaluation_0, severity: error, string: Evaluation should be in open state}: - - state == 'wait' + - state == 'wait' - - I close this survey request by giving answer of survey question. + I create a record for Survey Request. +- + !record {model: survey.request, id: survey_request_1}: + survey_id: survey_2 + user_id: base.user_demo + state: draft +- + I Create a record for interview evaluation. +- + !record {model: hr.evaluation.interview, id: evaluation_interview_0}: + evaluation_id: hr_evaluation_evaluation_0 + request_id: survey_request_1 +- + Give answer of the first page in "Employee Evaluation". +- + !python {model: survey.question.wiz}: | + ctx = {'active_model':'hr.evaluation.interview', 'active_id': ref('evaluation_interview_0'), 'active_ids': [ref('evaluation_interview_0')], 'survey_id': ref("survey_2")} + name_wiz_obj=self.pool.get('survey.name.wiz') + name_id = name_wiz_obj.create(cr, uid, {'survey_id': ref("survey_2")}) + ctx ["sur_name_id"] = name_id + self.create(cr, uid, {str(ref("survey_question_2")) +"_" +str(ref("survey_answer_1")) + "_multi" :'tpa', + str(ref("survey_question_2")) +"_" +str(ref("survey_answer_10")) + "_multi" :'application eng', + str(ref("survey_question_2")) +"_" +str(ref("survey_answer_20")) + "_multi" :'3', + str(ref("survey_question_2")) +"_" +str(ref("survey_answer_25")) + "_multi" :'2011-12-02 16:42:00', + str(ref("survey_question_2")) +"_" +str(ref("survey_answer_43")) + "_multi" :'HR', + str(ref("survey_question_2")) +"_" +str(ref("survey_answer_98")) + "_multi" :'tpa review' + }, context = ctx) +- + I close this Evaluation by giving answer of questions. - !python {model: hr_evaluation.evaluation}: | evaluation = self.browse(cr, uid, ref('hr_evaluation_evaluation_0')) @@ -72,4 +98,13 @@ I check that state of Evaluation is done. - !assert {model: hr_evaluation.evaluation, id: hr_evaluation_evaluation_0, severity: error, string: Evaluation should be in pending state}: - - state == 'done' \ No newline at end of file + - state == 'done' +- + Print Evaluations Statistics Report +- + !python {model: hr.evaluation.report}: | + import netsvc, tools, os, time + ctx={} + data_dict={'state': 'done', 'rating': 2, 'employee_id': ref("hr.employee1")} + from tools import test_reports + test_reports.try_report_action(cr, uid, 'hr_evaluation_evaluation_0',wiz_data=data_dict, context=ctx, our_module='hr_evaluation') \ No newline at end of file From 0c0718d36f9d99058a3c26b9c77594a1edb3054f Mon Sep 17 00:00:00 2001 From: "Turkesh Patel (Open ERP)" Date: Thu, 8 Dec 2011 11:01:43 +0530 Subject: [PATCH 3/5] [IMP] changes in strings and add assert bzr revid: tpa@tinyerp.com-20111208053143-lapbqd5grvn4lu0t --- .../hr_evaluation/test/test_hr_evaluation.yml | 22 +++++++++++-------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/addons/hr_evaluation/test/test_hr_evaluation.yml b/addons/hr_evaluation/test/test_hr_evaluation.yml index 2ae3f6702f2..18f5423f3df 100644 --- a/addons/hr_evaluation/test/test_hr_evaluation.yml +++ b/addons/hr_evaluation/test/test_hr_evaluation.yml @@ -1,10 +1,10 @@ - - I set the "Employee Evaluation" in open state. + I set the "Employee Evaluation" survey in open state. - !python {model: survey}: | self.survey_open(cr, uid, [ref("survey_2")], context) - - I check that state of "Employee Evaluation" is Open. + I check that state of "Employee Evaluation" survey is Open. - !assert {model: survey, id: survey_2, severity: error, string: Survey should be in OPen state}: - state == 'open' @@ -14,7 +14,7 @@ !python {model: hr_evaluation.evaluation}: | self.button_plan_in_progress(cr, uid, [ref('hr_evaluation_evaluation_0')]) - - I check that state is open. + I check that state is Plan in progress. - !assert {model: hr_evaluation.evaluation, id: hr_evaluation_evaluation_0, severity: error, string: Evaluation should be in open state}: - state == 'wait' @@ -22,11 +22,15 @@ I find a mistake on evaluation form. So I cancel the evaluation and again start it. - !python {model: hr_evaluation.evaluation}: | + evaluation = self.browse(cr, uid, ref('hr_evaluation_evaluation_0') , context) self.button_cancel(cr, uid, [ref('hr_evaluation_evaluation_0')]) + assert evaluation.state == 'cancel', 'Evaluation should be in cancel state' self.button_draft(cr, uid, [ref('hr_evaluation_evaluation_0')]) + evaluation = self.browse(cr, uid, ref('hr_evaluation_evaluation_0') , context) + assert evaluation.state == 'draft', 'Evaluation should be in draft state' self.button_plan_in_progress(cr, uid, [ref('hr_evaluation_evaluation_0')]) - - I check that state is open. + I check that state is "Plan in progress". - !assert {model: hr_evaluation.evaluation, id: hr_evaluation_evaluation_0, severity: error, string: Evaluation should be in open state}: - state == 'wait' @@ -44,7 +48,7 @@ evaluation_id: hr_evaluation_evaluation_0 request_id: survey_request_1 - - Give answer of the first page in "Employee Evaluation". + Give answer of the first page in "Employee Evaluation" survey. - !python {model: survey.question.wiz}: | ctx = {'active_model':'hr.evaluation.interview', 'active_id': ref('evaluation_interview_0'), 'active_ids': [ref('evaluation_interview_0')], 'survey_id': ref("survey_2")} @@ -59,7 +63,7 @@ str(ref("survey_question_2")) +"_" +str(ref("survey_answer_98")) + "_multi" :'tpa review' }, context = ctx) - - I close this Evaluation by giving answer of questions. + I close this Evaluation survey by giving answer of questions. - !python {model: hr_evaluation.evaluation}: | evaluation = self.browse(cr, uid, ref('hr_evaluation_evaluation_0')) @@ -69,7 +73,7 @@ interview = interview_obj.browse(cr, uid, survey.id, context) assert interview.state == "done", 'survey must be in done state' - - I print the survey. + I print the evaluation. - !python {model: hr_evaluation.evaluation}: | evaluation = self.browse(cr, uid, ref('hr_evaluation_evaluation_0')) @@ -80,7 +84,7 @@ !python {model: hr_evaluation.evaluation}: | self.button_final_validation(cr, uid, [ref("hr_evaluation_evaluation_0")]) - - I check that state is "Final Validation". + I check that state is "Waiting Appreciation". - !assert {model: hr_evaluation.evaluation, id: hr_evaluation_evaluation_0}: - state == 'progress' @@ -97,7 +101,7 @@ - I check that state of Evaluation is done. - - !assert {model: hr_evaluation.evaluation, id: hr_evaluation_evaluation_0, severity: error, string: Evaluation should be in pending state}: + !assert {model: hr_evaluation.evaluation, id: hr_evaluation_evaluation_0, severity: error, string: Evaluation should be in done state}: - state == 'done' - Print Evaluations Statistics Report From 2406bc38edec5a0e56ca067c43d3c84867145f70 Mon Sep 17 00:00:00 2001 From: "Turkesh Patel (Open ERP)" Date: Thu, 8 Dec 2011 15:02:54 +0530 Subject: [PATCH 4/5] [IMP] improvement in code bzr revid: tpa@tinyerp.com-20111208093254-lly247b899b71p1x --- .../hr_evaluation/test/test_hr_evaluation.yml | 21 +++++++------------ 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/addons/hr_evaluation/test/test_hr_evaluation.yml b/addons/hr_evaluation/test/test_hr_evaluation.yml index 18f5423f3df..6df33384cb3 100644 --- a/addons/hr_evaluation/test/test_hr_evaluation.yml +++ b/addons/hr_evaluation/test/test_hr_evaluation.yml @@ -29,29 +29,22 @@ evaluation = self.browse(cr, uid, ref('hr_evaluation_evaluation_0') , context) assert evaluation.state == 'draft', 'Evaluation should be in draft state' self.button_plan_in_progress(cr, uid, [ref('hr_evaluation_evaluation_0')]) + interview_obj = self.pool.get('hr.evaluation.interview') + interview_ids = interview_obj.search(cr, uid, [('evaluation_id','=', ref('hr_evaluation_evaluation_0'))]) + assert len(interview_ids), "Interview evaluation survey not created" - I check that state is "Plan in progress". - !assert {model: hr_evaluation.evaluation, id: hr_evaluation_evaluation_0, severity: error, string: Evaluation should be in open state}: - state == 'wait' -- - I create a record for Survey Request. -- - !record {model: survey.request, id: survey_request_1}: - survey_id: survey_2 - user_id: base.user_demo - state: draft -- - I Create a record for interview evaluation. -- - !record {model: hr.evaluation.interview, id: evaluation_interview_0}: - evaluation_id: hr_evaluation_evaluation_0 - request_id: survey_request_1 - Give answer of the first page in "Employee Evaluation" survey. - !python {model: survey.question.wiz}: | - ctx = {'active_model':'hr.evaluation.interview', 'active_id': ref('evaluation_interview_0'), 'active_ids': [ref('evaluation_interview_0')], 'survey_id': ref("survey_2")} + interview_obj = self.pool.get('hr.evaluation.interview') + interview_ids = interview_obj.search(cr, uid, [('evaluation_id','=', ref('hr_evaluation_evaluation_0'))]) + assert len(interview_ids), "Interview evaluation survey not created" + ctx = {'active_model':'hr.evaluation.interview', 'active_id': interview_ids[0], 'active_ids': [interview_ids], 'survey_id': ref("survey_2")} name_wiz_obj=self.pool.get('survey.name.wiz') name_id = name_wiz_obj.create(cr, uid, {'survey_id': ref("survey_2")}) ctx ["sur_name_id"] = name_id From 124ec45c3fb18816d2314bf01560235f7b0ba461 Mon Sep 17 00:00:00 2001 From: "Turkesh Patel (Open ERP)" Date: Thu, 8 Dec 2011 15:51:54 +0530 Subject: [PATCH 5/5] [IMP] Improvement in code bzr revid: tpa@tinyerp.com-20111208102154-dbfh9ll06rkoyndy --- .../hr_evaluation/test/test_hr_evaluation.yml | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/addons/hr_evaluation/test/test_hr_evaluation.yml b/addons/hr_evaluation/test/test_hr_evaluation.yml index 6df33384cb3..8875a83120d 100644 --- a/addons/hr_evaluation/test/test_hr_evaluation.yml +++ b/addons/hr_evaluation/test/test_hr_evaluation.yml @@ -14,9 +14,9 @@ !python {model: hr_evaluation.evaluation}: | self.button_plan_in_progress(cr, uid, [ref('hr_evaluation_evaluation_0')]) - - I check that state is Plan in progress. + I check that state is "Plan in progress". - - !assert {model: hr_evaluation.evaluation, id: hr_evaluation_evaluation_0, severity: error, string: Evaluation should be in open state}: + !assert {model: hr_evaluation.evaluation, id: hr_evaluation_evaluation_0, severity: error, string: Evaluation should be 'Plan in progress' state}: - state == 'wait' - I find a mistake on evaluation form. So I cancel the evaluation and again start it. @@ -29,23 +29,24 @@ evaluation = self.browse(cr, uid, ref('hr_evaluation_evaluation_0') , context) assert evaluation.state == 'draft', 'Evaluation should be in draft state' self.button_plan_in_progress(cr, uid, [ref('hr_evaluation_evaluation_0')]) +- + I check that state is "Plan in progress" and "Interview Request" record is created +- + !python {model: hr_evaluation.evaluation}: | interview_obj = self.pool.get('hr.evaluation.interview') + evaluation = self.browse(cr, uid, ref('hr_evaluation_evaluation_0') , context) + assert evaluation.state == 'wait', "Evaluation should be 'Plan in progress' state" interview_ids = interview_obj.search(cr, uid, [('evaluation_id','=', ref('hr_evaluation_evaluation_0'))]) assert len(interview_ids), "Interview evaluation survey not created" -- - I check that state is "Plan in progress". -- - !assert {model: hr_evaluation.evaluation, id: hr_evaluation_evaluation_0, severity: error, string: Evaluation should be in open state}: - - state == 'wait' - Give answer of the first page in "Employee Evaluation" survey. - !python {model: survey.question.wiz}: | + name_wiz_obj=self.pool.get('survey.name.wiz') interview_obj = self.pool.get('hr.evaluation.interview') interview_ids = interview_obj.search(cr, uid, [('evaluation_id','=', ref('hr_evaluation_evaluation_0'))]) assert len(interview_ids), "Interview evaluation survey not created" ctx = {'active_model':'hr.evaluation.interview', 'active_id': interview_ids[0], 'active_ids': [interview_ids], 'survey_id': ref("survey_2")} - name_wiz_obj=self.pool.get('survey.name.wiz') name_id = name_wiz_obj.create(cr, uid, {'survey_id': ref("survey_2")}) ctx ["sur_name_id"] = name_id self.create(cr, uid, {str(ref("survey_question_2")) +"_" +str(ref("survey_answer_1")) + "_multi" :'tpa', @@ -59,8 +60,8 @@ I close this Evaluation survey by giving answer of questions. - !python {model: hr_evaluation.evaluation}: | + interview_obj = self.pool.get('hr.evaluation.interview') evaluation = self.browse(cr, uid, ref('hr_evaluation_evaluation_0')) - interview_obj=self.pool.get('hr.evaluation.interview') interview_obj.survey_req_done(cr, uid, [r.id for r in evaluation.survey_request_ids]) for survey in evaluation.survey_request_ids: interview = interview_obj.browse(cr, uid, survey.id, context)