Skip to content

Commit

Permalink
[FIX] when holidays are note linked to calendar
Browse files Browse the repository at this point in the history
  • Loading branch information
ecino committed Jun 7, 2016
1 parent aade831 commit ebd50b7
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions crm_compassion/model/hr_holidays.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,14 @@ def holidays_validate(self):
"""
super(HrHolidays, self).holidays_validate()
for holidays in self:
holidays.meeting_id.write({
'allday': holidays.date_from[0:10] != holidays.date_to[0:10],
'partner_ids': [(6, 0, [holidays.user_id.partner_id.id])],
'start': holidays.date_from,
'stop': holidays.date_to,
})
if holidays.meeting_id and holidays.date_from and holidays.date_to:
partner_id = holidays.employee_id.address_home_id.id
holidays.meeting_id.write({
'allday':
holidays.date_from[0:10] != holidays.date_to[0:10],
'partner_ids': [(6, 0, [partner_id])] if partner_id else
False,
'start': holidays.date_from,
'stop': holidays.date_to,
})
return True

0 comments on commit ebd50b7

Please sign in to comment.