diff --git a/yuthon_will_task/models/yuthon_will_task.py b/yuthon_will_task/models/yuthon_will_task.py index 80664dbf6..7f08c319f 100644 --- a/yuthon_will_task/models/yuthon_will_task.py +++ b/yuthon_will_task/models/yuthon_will_task.py @@ -205,10 +205,10 @@ class YuthonWillTask(models.Model): def add_comment(self): employee_list = [] now = datetime.now() - timedelta(hours=8) - now_hour_minute = now.strftime("%H:%M") + now_truncated = now.replace(second=0, microsecond=0) for task in self.env['yuthon.dates.task'].search([('task_state', '=', 'to_do')]): - reminder_hour_minute = task.reminder_time.strftime("%H:%M") - if reminder_hour_minute == now_hour_minute: + reminder_truncated = task.reminder_time.replace(second=0, microsecond=0) + if reminder_truncated == now_truncated: task.task_state = 'done' for task_time in task.employee_ids: employee_list.append(task_time.employee_id)