summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2015-12-03 19:00:19 +0100
committerChristophe Simonis <chs@odoo.com>2015-12-03 19:00:19 +0100
commit5fb29dedd1699dff5756ae2ed284fdff59cd9e34 (patch)
tree36233ba54b9a6770618b38ca1f22655f7ddaed0e /addons
parenta6ad7b9b250c6f1f6f11c93318da9149e0814863 (diff)
[FIX] hr_recruitement: correct search of default stage on applicants
Diffstat (limited to 'addons')
-rw-r--r--addons/hr_recruitment/models/hr_recruitment.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/addons/hr_recruitment/models/hr_recruitment.py b/addons/hr_recruitment/models/hr_recruitment.py
index 60faef49674..55ef7d49c3f 100644
--- a/addons/hr_recruitment/models/hr_recruitment.py
+++ b/addons/hr_recruitment/models/hr_recruitment.py
@@ -86,10 +86,12 @@ class Applicant(models.Model):
def _default_stage_id(self):
if self._context.get('default_job_id'):
- return self.env['hr.recruitment.stage'].search([
+ ids = self.env['hr.recruitment.stage'].search([
('job_ids', '=', self._context['default_job_id']),
('fold', '=', False)
- ], order='sequence asc', limit=1).ids[0]
+ ], order='sequence asc', limit=1).ids
+ if ids:
+ return ids[0]
return False
def _default_company_id(self):