[IMP] hr_holidays: use employee's partner to invite him to the event of his time-off
Events for time-off created with robodoo (demo data) wouldn’t invite the partner related to a time off event as that partner didn’t have an user counterpart. However, since he is an employee, he has a partner and can be added to the event. This commit changes the check to fallback to the employee partner if the user does not exist. task-3455051 task-3389317 Part-of: odoo/odoo#138670
This commit is contained in:
@@ -1025,9 +1025,9 @@ class HolidaysRequest(models.Model):
|
||||
'res_id': holiday.id,
|
||||
}
|
||||
# Add the partner_id (if exist) as an attendee
|
||||
if user and user.partner_id:
|
||||
meeting_values['partner_ids'] = [
|
||||
(4, user.partner_id.id)]
|
||||
partner_id = (user and user.partner_id) or (holiday.employee_id and holiday.employee_id.work_contact_id)
|
||||
if partner_id:
|
||||
meeting_values['partner_ids'] = [(4, partner_id.id)]
|
||||
result[user.id].append(meeting_values)
|
||||
return result
|
||||
|
||||
|
||||
Reference in New Issue
Block a user