diff --git a/addons/hr_recruitment/hr_recruitment.py b/addons/hr_recruitment/hr_recruitment.py index 44f5e42a4e4..3c074b4e1ad 100644 --- a/addons/hr_recruitment/hr_recruitment.py +++ b/addons/hr_recruitment/hr_recruitment.py @@ -323,10 +323,15 @@ class hr_applicant(base_stage, osv.Model): @return: Dictionary value for created Meeting view """ applicant = self.browse(cr, uid, ids[0], context) + applicant_ids = [] + if applicant.partner_id: + applicant_ids.append(applicant.partner_id.id) + if applicant.department_id and applicant.department_id.manager_id and applicant.department_id.manager_id.address_id: + applicant_ids.append(applicant.department_id.manager_id.address_id.id) category = self.pool.get('ir.model.data').get_object(cr, uid, 'hr_recruitment', 'categ_meet_interview', context) res = self.pool.get('ir.actions.act_window').for_xml_id(cr, uid, 'base_calendar', 'action_crm_meeting', context) res['context'] = { - 'default_partner_ids': applicant.partner_id and [applicant.partner_id.id] or False, + 'default_partner_ids': applicant_ids or False, 'default_user_id': uid, 'default_name': applicant.name, 'default_categ_ids': category and [category.id] or False,