2011-11-18 12:54:30 +00:00
|
|
|
-
|
|
|
|
In Order to test process of Recruitment,
|
|
|
|
-
|
|
|
|
Applicant interested in job position. so He send resume by email.
|
|
|
|
-
|
|
|
|
!python {model: mail.thread}: |
|
|
|
|
import addons
|
|
|
|
request_file = open(addons.get_module_resource('hr_recruitment','test', 'resume.eml'),'rb')
|
|
|
|
request_message = request_file.read()
|
|
|
|
self.message_process(cr, uid, 'hr.applicant', request_message)
|
|
|
|
-
|
|
|
|
After getting the mail, I check details of new applicant.
|
|
|
|
-
|
|
|
|
!python {model: hr.applicant}: |
|
|
|
|
applicant_ids = self.search(cr, uid, [('email_from','=', 'Mr. Richard Anderson <Richard_Anderson@yahoo.com>')])
|
|
|
|
assert applicant_ids, "Applicant is not created after getting the mail"
|
|
|
|
applicant = self.browse(cr, uid, applicant_ids[0], context=context)
|
2011-11-28 06:22:47 +00:00
|
|
|
resume_ids = self.pool.get('ir.attachment').search(cr, uid, [('datas_fname','=','resume.doc'),('res_model','=',self._name),('res_id','=',applicant.id)])
|
|
|
|
assert applicant.name == "Application for the post of Jr.application Programmer.", "Subject does not match"
|
2011-11-18 12:54:30 +00:00
|
|
|
assert applicant.state == "draft"
|
2011-11-28 06:22:47 +00:00
|
|
|
assert len(resume_ids), "Resume does not attached."
|
2011-11-18 12:54:30 +00:00
|
|
|
-
|
2011-12-14 10:17:28 +00:00
|
|
|
I refuse applicant for the Recruitment.
|
2011-11-18 12:54:30 +00:00
|
|
|
-
|
|
|
|
!python {model: hr.applicant}: |
|
2011-12-09 09:51:02 +00:00
|
|
|
self.case_close(cr, uid, [ref("hr_case_programmer")])
|
2011-11-18 12:54:30 +00:00
|
|
|
-
|
2011-12-09 09:51:02 +00:00
|
|
|
I open applicant for the Recruitment.
|
2011-11-18 12:54:30 +00:00
|
|
|
-
|
|
|
|
!python {model: hr.applicant}: |
|
2011-12-09 09:51:02 +00:00
|
|
|
self.case_reset(cr, uid, [ref("hr_case_programmer")])
|
2011-11-18 12:54:30 +00:00
|
|
|
self.case_open(cr, uid, [ref("hr_case_programmer")])
|
2011-12-09 09:51:02 +00:00
|
|
|
-
|
|
|
|
I assign the Job position to the applicant
|
|
|
|
-
|
|
|
|
!python {model: hr.applicant}: |
|
2011-12-22 13:52:14 +00:00
|
|
|
self.write(cr, uid, [ref('hr_case_programmer')], {'job_id':ref('hr.job_developer')})
|
2011-11-18 12:54:30 +00:00
|
|
|
-
|
|
|
|
I start communication with applicant, first schedule phonecall.
|
|
|
|
-
|
|
|
|
!python {model: hr.recruitment.job2phonecall}: |
|
2011-12-09 12:08:25 +00:00
|
|
|
context.update({'active_model': 'hr.applicant', 'active_id': ref("hr_case_programmer"), 'active_ids': [ref("hr_case_programmer")], 'survey_id': ref("survey_job_0")})
|
2011-12-14 09:37:45 +00:00
|
|
|
id = self.create(cr, uid, {}, context=context)
|
|
|
|
self.make_phonecall(cr, uid, [id], context=context)
|
2011-11-18 12:54:30 +00:00
|
|
|
-
|
|
|
|
I schedule meeting with applicant for interview.
|
|
|
|
-
|
|
|
|
!python {model: hr.applicant}: |
|
|
|
|
self.action_makeMeeting(cr, uid, [ref('hr_case_programmer')])
|
2011-12-09 09:51:02 +00:00
|
|
|
-
|
|
|
|
I check Initial Qualification of applicant.
|
|
|
|
-
|
|
|
|
!python {model: hr.applicant}: |
|
|
|
|
self.stage_next(cr, uid, [ref('hr_case_programmer')])
|
|
|
|
-
|
|
|
|
I schedule First Interview of applicant.
|
|
|
|
-
|
|
|
|
!python {model: hr.applicant}: |
|
|
|
|
self.stage_next(cr, uid, [ref('hr_case_programmer')])
|
|
|
|
-
|
|
|
|
On a successful First Interview of applicant, I schedule Second Interview.
|
|
|
|
-
|
|
|
|
!python {model: hr.applicant}: |
|
|
|
|
self.stage_next(cr, uid, [ref('hr_case_programmer')])
|
2011-11-18 12:54:30 +00:00
|
|
|
-
|
|
|
|
Applicant fillup the answer of the interview quetion.
|
|
|
|
-
|
|
|
|
!python {model: survey.question.wiz}: |
|
|
|
|
ctx = context.copy()
|
|
|
|
ctx.update({'active_model': 'hr.applicant', 'active_id': ref("hr_case_programmer"), 'active_ids': [ref("hr_case_programmer")], 'survey_id': ref("survey_job_0")})
|
|
|
|
self.fields_view_get(cr, uid, ref("survey.view_survey_question_message"),"form", context=ctx)
|
|
|
|
vals = self.default_get(cr, uid , [], context=ctx)
|
|
|
|
self.create(cr, uid, vals, context=ctx)
|
|
|
|
self.action_new_page(cr, uid, [ref("survey_job_0")], context=ctx)
|
|
|
|
-
|
|
|
|
I print Applicant fill up the interview quetion
|
|
|
|
-
|
|
|
|
!python {model: hr.applicant}: |
|
|
|
|
self.action_print_survey(cr, uid, [ref('hr_case_programmer')])
|
|
|
|
-
|
2011-12-09 09:51:02 +00:00
|
|
|
On a successful Second Interview of applicant Contract is Proposed to applicant.
|
|
|
|
-
|
|
|
|
!python {model: hr.applicant}: |
|
|
|
|
self.stage_next(cr, uid, [ref('hr_case_programmer')])
|
|
|
|
self.stage_previous(cr, uid, [ref('hr_case_programmer')])
|
|
|
|
-
|
2011-12-09 11:38:32 +00:00
|
|
|
I Hired Applicant.
|
2011-11-18 12:54:30 +00:00
|
|
|
-
|
|
|
|
!python {model: hr.applicant}: |
|
2011-11-28 06:33:18 +00:00
|
|
|
self.case_close_with_emp(cr, uid, [ref('hr_case_programmer')])
|
2011-11-18 12:54:30 +00:00
|
|
|
-
|
|
|
|
I check that applicant is "Hired".
|
|
|
|
-
|
|
|
|
!assert {model: hr.applicant, id: hr_case_programmer}:
|
2011-11-28 06:22:47 +00:00
|
|
|
- state == 'done'
|
2011-12-09 11:38:32 +00:00
|
|
|
-
|
2011-12-14 10:17:28 +00:00
|
|
|
I do not give employment to the hired the applicant.
|
2011-12-09 11:38:32 +00:00
|
|
|
-
|
|
|
|
!python {model: hired.employee}: |
|
|
|
|
context.update({'active_model': 'hr.applicant', 'active_ids': [ref("hr_recruitment.hr_case_programmer")], 'active_id': ref("hr_recruitment.hr_case_programmer")})
|
|
|
|
emp_id = self.create(cr, uid, {}, context=context)
|
|
|
|
self.case_close(cr, uid, [emp_id], context=context)
|
|
|
|
-
|
2011-12-14 10:17:28 +00:00
|
|
|
Now I give employment to hired applicant .
|
2011-12-09 11:38:32 +00:00
|
|
|
-
|
|
|
|
!python {model: hr.applicant}: |
|
2011-12-14 10:17:28 +00:00
|
|
|
hired_emp_obj = self.pool.get('hired.employee')
|
2011-12-09 11:38:32 +00:00
|
|
|
self.case_reset(cr, uid, [ref("hr_case_programmer")])
|
|
|
|
self.case_open(cr, uid, [ref("hr_case_programmer")])
|
|
|
|
context.update({'active_model': 'hr.applicant', 'active_ids': [ref("hr_recruitment.hr_case_programmer")], 'active_id': ref("hr_recruitment.hr_case_programmer")})
|
2011-12-14 10:17:28 +00:00
|
|
|
emp_hr_id = hired_emp_obj.create(cr, uid, {}, context=context)
|
|
|
|
hired_emp_obj.case_close_with_emp(cr, uid, [emp_hr_id], context=context)
|
2011-12-09 11:38:32 +00:00
|
|
|
-
|
2011-12-14 10:17:28 +00:00
|
|
|
Now hired employee want to be a partner of company.
|
2011-12-09 10:55:22 +00:00
|
|
|
-
|
|
|
|
!record {model: hr.recruitment.partner.create, id: hr_recruitment_partner_id1 }:
|
|
|
|
-
|
|
|
|
!python {model: hr.recruitment.partner.create}: |
|
|
|
|
context.update({'active_model': 'hr.applicant', 'active_ids': [ref("hr_recruitment.hr_case_programmer")], 'active_id': ref("hr_recruitment.hr_case_programmer")})
|
|
|
|
self.make_order(cr, uid, [ref("hr_recruitment_partner_id1")], context=context)
|