odoo/addons/hr/test/open2recruit2close_job.yml

44 lines
1.6 KiB
YAML

-
Give the access rights of Hr Officer to the user to test the process of Human Resource Management.
-
!context
uid: 'res_users_hr_officer'
-
In order to test the process of Human Resource Management, I open Job Postion for "Developer".
-
!python {model: hr.job}: |
self.job_open(cr, uid, [ref('job_developer')])
-
I check state of Job Position after opening it.
-
!assert {model: hr.job, id: job_developer, string: Job position is in 'open' state and no_of_recruitment = 0}:
- state == 'open'
- no_of_recruitment == 0
-
Now, Recruitment is started so I start recruitment of Job Postion of "Developer" Profile.
-
!python {model: hr.job}: |
self.job_recruitment(cr, uid, [ref('job_developer')])
-
I check 'state' and number of 'Expected in Recruitment' after initiating the recruitment
-
!assert {model: hr.job, id: job_developer, string: Job position is in 'recruit' state and no_of_recruitment = 1.0}:
- state == 'recruit'
- no_of_recruitment == 1.0
-
I assign the job position to a newly hired employee
-
!python {model: hr.employee}: |
self.write(cr, uid, [ref('employee_niv')], {'job_id':ref('job_developer')})
-
Now I dont want to recruit new employee for this position. so I mark it as Open.
-
!python {model: hr.job}: |
self.job_open(cr, uid, [ref('job_developer')])
-
I check 'state' and number of 'Expected in Recruitment' after closing the Job position.
-
!assert {model: hr.job, id: job_developer, string: Job position is in 'open' state and no_of_recruitment = 0}:
- state == 'open'
- no_of_recruitment == 0