This commit is contained in:
Bakry 2025-01-13 14:25:13 +03:00
parent da94b6c667
commit 4ec2409584
2 changed files with 11 additions and 1 deletions

View File

@ -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):

View File

@ -738,6 +738,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()