添加功能
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user