[FIX] hr_recruitment: Missing stage with department

When 'search_default_job_id' is in the context, the department set for
this job must be used to filter the right stages(_read_group_stage_ids).

opw:685896
This commit is contained in:
Goffin Simon
2016-08-23 14:10:08 +02:00
parent 2ab7d92c82
commit 0b80da48b5
+2
View File
@@ -168,6 +168,8 @@ class hr_applicant(osv.Model):
department_ids = self.pool.get('hr.department').name_search(cr, uid, name=department_name, context=context)
if len(department_ids) == 1:
return int(department_ids[0][0])
if context.get('search_default_job_id'):
return self.pool['hr.job'].browse(cr, uid, context.get('search_default_job_id'))[0].department_id.id
return None
def _get_default_company_id(self, cr, uid, department_id=None, context=None):