2011-11-18 12:54:30 +00:00
|
|
|
-
|
2013-02-21 10:39:22 +00:00
|
|
|
Create a user as 'HR Recruitment Officer'
|
2013-03-19 09:33:08 +00:00
|
|
|
-
|
2013-10-03 14:32:34 +00:00
|
|
|
!record {model: res.users, id: res_users_hr_recruitment_officer, view: False}:
|
2013-02-21 10:39:22 +00:00
|
|
|
company_id: base.main_company
|
2013-05-07 09:02:04 +00:00
|
|
|
name: HR Recruitment Officer
|
2013-02-21 10:39:22 +00:00
|
|
|
login: hrro
|
2013-03-20 05:40:49 +00:00
|
|
|
email: hrofcr@yourcompany.com
|
2013-05-07 09:02:04 +00:00
|
|
|
-
|
|
|
|
I added groups for HR Recruitment Officer.
|
|
|
|
-
|
|
|
|
!record {model: res.users, id: res_users_hr_recruitment_officer}:
|
|
|
|
groups_id:
|
|
|
|
- base.group_hr_user
|
2013-02-21 10:39:22 +00:00
|
|
|
-
|
|
|
|
In Order to test process of Recruitment so giving HR officer's rights,
|
|
|
|
-
|
|
|
|
!context
|
2013-05-07 09:34:13 +00:00
|
|
|
uid: 'res_users_hr_recruitment_officer'
|
2011-11-18 12:54:30 +00:00
|
|
|
-
|
2012-05-25 11:51:43 +00:00
|
|
|
An applicant is interested in the job position. So he sends a resume by email.
|
2011-11-18 12:54:30 +00:00
|
|
|
-
|
|
|
|
!python {model: mail.thread}: |
|
2013-04-17 06:40:51 +00:00
|
|
|
request_file = open(openerp.modules.module.get_module_resource('hr_recruitment','test', 'resume.eml'),'rb')
|
2011-11-18 12:54:30 +00:00
|
|
|
request_message = request_file.read()
|
|
|
|
self.message_process(cr, uid, 'hr.applicant', request_message)
|
|
|
|
-
|
2012-05-25 11:51:43 +00:00
|
|
|
After getting the mail, I check the details of the new applicant.
|
2011-11-18 12:54:30 +00:00
|
|
|
-
|
|
|
|
!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)
|
2012-10-18 12:18:20 +00:00
|
|
|
resume_ids = self.pool.get('ir.attachment').search(cr, uid, [('datas_fname','=','resume.pdf'),('res_model','=',self._name),('res_id','=',applicant.id)])
|
2012-05-23 11:52:36 +00:00
|
|
|
assert applicant.name == "Application for the post of Jr.application Programmer.", "Applicant name does not match."
|
2012-05-25 12:22:34 +00:00
|
|
|
assert applicant.stage_id.id == ref('hr_recruitment.stage_job1'), "Stage should be 'Initial qualification' and is '%s'." % (applicant.stage_id.name)
|
2013-06-27 09:48:07 +00:00
|
|
|
assert applicant.stage_id.sequence == 1, "Applicant stage sequence should be 1."
|
2012-05-25 12:22:34 +00:00
|
|
|
assert len(resume_ids), "Resume is not attached."
|
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 schedule meeting with applicant for interview.
|
|
|
|
-
|
|
|
|
!python {model: hr.applicant}: |
|
|
|
|
self.action_makeMeeting(cr, uid, [ref('hr_case_programmer')])
|
|
|
|
-
|
|
|
|
I print Applicant fill up the interview quetion
|
|
|
|
-
|
|
|
|
!python {model: hr.applicant}: |
|
2011-12-09 11:38:32 +00:00
|
|
|
context.update({'active_model': 'hr.applicant', 'active_ids': [ref("hr_recruitment.hr_case_programmer")], 'active_id': ref("hr_recruitment.hr_case_programmer")})
|
2013-07-08 09:11:56 +00:00
|
|
|
self.action_print_survey(cr, uid, [ref('hr_case_programmer')])
|
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)
|