[FIX] hr_holidays: fixed potential crash
This was introduced by migration commit 46ccb7036f
This commit is contained in:
@@ -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([
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user