[FIX] hr_holidays: avoid execution of onchange when no employee linked

If the current user is not linked to any employee we cannot retrieve his
calendar and so we cannot compute default times for the leave.
This commit is contained in:
RomainLibert
2018-06-14 16:38:18 +02:00
parent a4290faebf
commit dff3cd6319
+3
View File
@@ -146,6 +146,9 @@ class HolidaysRequest(models.Model):
date_from = False
date_to = False
if not self.employee_id:
return
if self.request_date_from:
if self.date_from:
date_from = fields.Datetime.to_string(datetime.combine(fields.Date.from_string(self.request_date_from), fields.Datetime.from_string(self.date_from).time()))