添加功能

This commit is contained in:
李鹏宇
2025-12-18 12:01:23 +08:00
parent 75ab959379
commit 1df598b0e3
+3 -3
View File
@@ -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)