-
  In order to test hr_recruitment module for OpenERP, I will create applicants form, Manages job positions and the recruitment process.
-

  I create a department.
-
  !record {model: hr.department, id: hr_department_rd0}:
    manager_id: base.user_root
    name: 'R & D '

-
  I create new Job Position.
-
  !record {model: hr.job, id: hr_job_jea0}:
    department_id: 'hr_department_rd0'
    description: 'Position of Jr. Application Engineer'
    expected_employees: 5
    name: 'JAE '
-
  I create a recruitment stage "Initial Jobs Demand".
-
  !record {model: hr.recruitment.stage, id: hr_recrutiment_stage_first0}:
    name: 'Initial Jobs Demand'
    sequence: 1
-
  I create an applicant.
-
  !record {model: hr.applicant, id: hr_applicant_fresher0}:
    availability: 0.0
    department_id: hr.dep_it
    name: Fresher
    partner_address_id: base.res_partner_address_tang
    partner_id: base.res_partner_asus
    partner_name: Marion Jones
    partner_phone: '1111112223'
    response: 0.0
    job_id: hr.job_jr_developers
    salary_expected: 0.0
    salary_proposed: 0.0
    stage_id: hr_recrutiment_stage_first0
    type_id: hr_recruitment.degree_licenced

-
  I check that applicant is on "draft" state.
-
  !assert {model: hr.applicant, id:  hr_applicant_fresher0}:
    - state == 'draft'

-
  I change the state by click on "In Progress" button.
-
  !python {model: hr.applicant}: |
    self.case_open(cr, uid, [ref("hr_applicant_fresher0")], {"active_ids": [ref("hr_recruitment.menu_crm_case_categ0_act_job")],
      })

-
  I create a new case category.
-
  !record {model: crm.case.categ, id: crm_case_categ_employee0}:
    name: 'Employee'

-
  I schedule a phonecall for this applicant by click on "Schedule a Phone Call" button.
-
  !record {model: hr.recruitment.job2phonecall, id: hr_recruitment_forinterview0}:
    user_id: base.user_root
    deadline: !eval time.strftime('%Y-%m-%d 11:51:00')
    note: 'For interview.'
    category_id: 'crm_case_categ_employee0'

-
  I click on "Schedule phonecall" button of this wizard.
-
  !python {model: hr.recruitment.job2phonecall}: |
     self.make_phonecall(cr, uid, [ref('hr_recruitment_forinterview0')], {'active_ids': [ref('hr_applicant_fresher0')]})

-
  I schedule meeting for interview of this applicant by click on "Schedule Meeting" button.
-
  !python {model: hr.applicant}: |
     self.action_makeMeeting(cr, uid, [ref('hr_recruitment_forinterview0')])
-
  I create an entry for the meeting with the applicant.
-
  !record {model: crm.meeting, id: crm_meeting_fresher0}:
    alarm_id: base_calendar.alarm1
    count: 0.0
    date: !eval "(datetime.now() + timedelta(1)).strftime('%Y-%m-%d 00:00:00')" 
    date_deadline: !eval "(datetime.now() + timedelta(1)).strftime('%Y-%m-%d 08:00:00')" 
    day: 0.0
    duration: 8.0
    name: Fresher
    opportunity_id: crm.crm_case_construstazunits0
    partner_address_id: base.res_partner_address_tang
    partner_id: base.res_partner_asus
    recurrent_uid: 0.0
    rrule_type: none
    state: open
    user_id: base.user_root

-
  On a successful meeting with the applicant, I hired employee by click on "Hired" button.
-
  !python {model: hr.applicant}: |
     self.case_close(cr, uid, [ref('hr_applicant_fresher0')])
-
  I check that applicant state is "Hired".
-
  !assert {model: hr.applicant, id: hr_applicant_fresher0}:
    - state == 'done'
