diff --git a/addons/hr_holidays/models/hr.py b/addons/hr_holidays/models/hr.py index dc97ff82532..3e28db938b9 100644 --- a/addons/hr_holidays/models/hr.py +++ b/addons/hr_holidays/models/hr.py @@ -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([ diff --git a/addons/hr_holidays/models/hr_holidays.py b/addons/hr_holidays/models/hr_holidays.py index 0492121f6d2..6fcd0e5f337 100644 --- a/addons/hr_holidays/models/hr_holidays.py +++ b/addons/hr_holidays/models/hr_holidays.py @@ -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: