From 93e5d6156aa4ecb1bc61d21a3c64633ed041e092 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=B9=8F=E5=AE=87?= <9664676+pengyuthon@user.noreply.gitee.com> Date: Tue, 18 Nov 2025 18:31:31 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- yuthon_hr_attendance/models/hr_attendance.py | 4 ++-- yuthon_property/models/property_meter_archives.py | 9 ++++++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/yuthon_hr_attendance/models/hr_attendance.py b/yuthon_hr_attendance/models/hr_attendance.py index 6c2aaa4b5..4a6067d8b 100644 --- a/yuthon_hr_attendance/models/hr_attendance.py +++ b/yuthon_hr_attendance/models/hr_attendance.py @@ -801,8 +801,8 @@ class HrAttendance(models.Model): next_call = cron.nextcall + timedelta(hours=8) start_window = next_call - timedelta(minutes=5) end_window = next_call + timedelta(minutes=5) - if not (start_window <= fields.Datetime.now() <= end_window): - return + # if not (start_window <= fields.Datetime.now() <= end_window): + # return slot_start = datetime.combine(current_date, datetime.min.time()) slot_end = datetime.combine(current_date + timedelta(days=1), datetime.min.time()) domain = [ diff --git a/yuthon_property/models/property_meter_archives.py b/yuthon_property/models/property_meter_archives.py index 7ea550986..2cdaa8d0b 100644 --- a/yuthon_property/models/property_meter_archives.py +++ b/yuthon_property/models/property_meter_archives.py @@ -254,6 +254,12 @@ class MeterArchivesLine(models.Model): if diff_ratio > 0.5: rec.is_abnormal = True + def update_is_abnormal(self): + archives_ids = self.env["meter.archives.line"].browse( + self._context.get('active_ids', self._context.get('active_id'))) + for ins in archives_ids: + ins._compute_is_abnormal() + @api.model_create_multi def create(self, vals_list): records = super().create(vals_list) @@ -380,9 +386,6 @@ class MeterArchivesLine(models.Model): else: record.lessee_id = False - def update_date(self): - pass - def push_task_push_wizard(self): meter_ids = self.env["meter.archives.line"].browse( self._context.get("active_ids", self._context.get("active_id")) From 089e256cd950c54c538acbf229ee83ac4d751693 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=B9=8F=E5=AE=87?= <9664676+pengyuthon@user.noreply.gitee.com> Date: Tue, 18 Nov 2025 18:31:44 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- yuthon_hr_attendance/models/hr_attendance.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/yuthon_hr_attendance/models/hr_attendance.py b/yuthon_hr_attendance/models/hr_attendance.py index 4a6067d8b..6c2aaa4b5 100644 --- a/yuthon_hr_attendance/models/hr_attendance.py +++ b/yuthon_hr_attendance/models/hr_attendance.py @@ -801,8 +801,8 @@ class HrAttendance(models.Model): next_call = cron.nextcall + timedelta(hours=8) start_window = next_call - timedelta(minutes=5) end_window = next_call + timedelta(minutes=5) - # if not (start_window <= fields.Datetime.now() <= end_window): - # return + if not (start_window <= fields.Datetime.now() <= end_window): + return slot_start = datetime.combine(current_date, datetime.min.time()) slot_end = datetime.combine(current_date + timedelta(days=1), datetime.min.time()) domain = [