[FIX] hr_recruitment: no crash when default stage not found
This commit is contained in:
@@ -228,10 +228,11 @@ class Applicant(models.Model):
|
||||
department_id = job.department_id.id
|
||||
user_id = job.user_id.id
|
||||
if not self.stage_id:
|
||||
stage_id = self.env['hr.recruitment.stage'].search([
|
||||
stage_ids = self.env['hr.recruitment.stage'].search([
|
||||
('job_ids', '=', job.id),
|
||||
('fold', '=', False)
|
||||
], order='sequence asc', limit=1).ids[0]
|
||||
], order='sequence asc', limit=1).ids
|
||||
stage_id = stage_ids[0] if stage_ids else False
|
||||
|
||||
return {'value': {
|
||||
'department_id': department_id,
|
||||
|
||||
Reference in New Issue
Block a user