[FIX] hr_holidays: fixed potential crash

This was introduced by migration commit 46ccb7036f
This commit is contained in:
Ravi Gohil
2016-06-15 09:47:10 +02:00
committed by Jérome Maes
parent 0eaec119f7
commit ec77764e8d
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -184,7 +184,7 @@ class Employee(models.Model):
@api.multi
def _compute_absent_employee(self):
today_date = datetime.utcnow().date()
today_date = datetime.datetime.utcnow().date()
today_start = fields.Datetime.to_string(today_date) # get the midnight of the current utc day
today_end = fields.Datetime.to_string(today_date + relativedelta(hours=23, minutes=59, seconds=59))
data = self.env['hr.holidays'].read_group([
@@ -203,7 +203,7 @@ class Employee(models.Model):
@api.multi
def _search_absent_employee(self, operator, value):
today_date = datetime.utcnow().date()
today_date = datetime.datetime.utcnow().date()
today_start = fields.Datetime.to_string(today_date) # get the midnight of the current utc day
today_end = fields.Datetime.to_string(today_date + relativedelta(hours=23, minutes=59, seconds=59))
holiday_values = self.env['hr.holidays'].search_read([
+1 -1
View File
@@ -94,7 +94,7 @@ class HolidaysType(models.Model):
@api.multi
def _compute_leaves(self):
employee_id = False
data_days = {}
if 'employee_id' in self._context:
employee_id = self._context['employee_id']
else: