From d39f5169560120efb0d5922dfb57d28f81745079 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, 16 Mar 2026 16:34:15 +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/controllers/applet_attendance.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/yuthon_hr_attendance/controllers/applet_attendance.py b/yuthon_hr_attendance/controllers/applet_attendance.py index e7ca6259a..889422d8f 100644 --- a/yuthon_hr_attendance/controllers/applet_attendance.py +++ b/yuthon_hr_attendance/controllers/applet_attendance.py @@ -1161,8 +1161,12 @@ class AppletAttendance(Controller): 'current_read': clean_floats(record.current_read), 'current_meter': clean_floats(record.current_meter) } - if record.archives_id.name not in code_list: - code_list.append(record.archives_id.name) + if type == 'water': + current_name = record.water_id.name if record.water_id else '' + else: + current_name = record.archives_id.name if record.archives_id else '' + if current_name and current_name not in code_list: + code_list.append(current_name) result.append(tvalue) return json.dumps(result, allow_nan=False)