From 46c5eb926a823c1cef1de99beaf2b0a3e6c6eca7 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: Mon, 8 Sep 2025 09:46:27 +0800 Subject: [PATCH] =?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 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/yuthon_hr_attendance/models/hr_attendance.py b/yuthon_hr_attendance/models/hr_attendance.py index 7252c6084..6ceb90826 100644 --- a/yuthon_hr_attendance/models/hr_attendance.py +++ b/yuthon_hr_attendance/models/hr_attendance.py @@ -128,7 +128,8 @@ class HrAttendance(models.Model): # 保留第一条记录,删除其余 ids_to_keep = record_ids[0] ids_to_delete = record_ids[1:] - self.env["hr.attendance"].browse(ids_to_delete).unlink() + if ids_to_delete: + self.env["hr.attendance"].browse(ids_to_delete).unlink() # @api.model # def web_read_group(self, domain, fields, groupby, limit=None, offset=0, orderby=False, lazy=True):