@@ -168,13 +168,15 @@ class YuthonWillTask(models.Model):
|
||||
return timedelta.max
|
||||
|
||||
def add_comment(self):
|
||||
"日程定时任务提醒"
|
||||
"""日程定时任务提醒"""
|
||||
_logger.info('-----------日程任务验证--------')
|
||||
now = fields.datetime.now() + timedelta(hours=8)
|
||||
dates_task_ids = self.env['yuthon.dates.task'].search([('task_state', '=', 'to_do'), ('reminder_time', '<', fields.datetime.now() + timedelta(days=1))])
|
||||
for task in dates_task_ids:
|
||||
hour1 = (task.reminder_time + timedelta(hours=8)).hour
|
||||
minute1 = (task.reminder_time + timedelta(hours=8)).minute
|
||||
if minute1 == now.minute and hour1 == now.hour:
|
||||
_logger.info(f'-任务时间{hour1}:{minute1}任务分钟{now.hour}:{now.minute}')
|
||||
task.write({'task_state': 'done'})
|
||||
will_id = task.yuthon_will_task_id
|
||||
for employee_id in will_id.employee_ids:
|
||||
|
||||
Reference in New Issue
Block a user