commit
31fb9630c6
|
|
@ -446,7 +446,10 @@ class Attendance(models.Model):
|
|||
def _compute_is_today(self):
|
||||
today = datetime.now().date()
|
||||
for record in self:
|
||||
record.is_today = record.action_date == today
|
||||
if record.action_date == today:
|
||||
record.is_today = True
|
||||
else:
|
||||
record.is_today = False
|
||||
|
||||
@api.depends('name')
|
||||
def compute_date(self):
|
||||
|
|
|
|||
|
|
@ -636,6 +636,13 @@ class HrAttendanceTransactions(models.Model):
|
|||
('name', '=', 'to_attendance_device_custom')]) \
|
||||
and True or False
|
||||
attendance_pool = self.env['attendance.attendance']
|
||||
##remove today from not to day in attendance
|
||||
today = datetime.now().date()
|
||||
not_today = attendance_pool.search([('is_today', '=', True),('action_date', '<', today)])
|
||||
if not_today:
|
||||
for att in not_today:
|
||||
att._compute_is_today()
|
||||
##end
|
||||
low_date = (datetime.utcnow()).date() if not attendance_date else attendance_date
|
||||
if isinstance(low_date, datetime):
|
||||
low_date = low_date.date()
|
||||
|
|
|
|||
Loading…
Reference in New Issue