[IMP] hr_recruitment: set company_id on change department

This commit is contained in:
Denis Ledoux 2014-12-09 17:51:47 +01:00
parent da12f2b809
commit c5ec6f397d
1 changed files with 6 additions and 2 deletions

View File

@ -256,9 +256,13 @@ class hr_applicant(osv.Model):
return {'value': {'department_id': department_id, 'user_id': user_id}}
def onchange_department_id(self, cr, uid, ids, department_id=False, stage_id=False, context=None):
values = {}
if not stage_id:
stage_id = self.stage_find(cr, uid, [], department_id, [('fold', '=', False)], context=context)
return {'value': {'stage_id': stage_id}}
values['stage_id'] = self.stage_find(cr, uid, [], department_id, [('fold', '=', False)], context=context)
if department_id:
department = self.pool['hr.department'].browse(cr, uid, department_id, context=context)
values['company_id'] = department.company_id.id
return {'value': values}
def onchange_partner_id(self, cr, uid, ids, partner_id, context=None):
data = {'partner_phone': False,