From f4de14df0e6f3536cdf21baeb2a0288e2eb9630e Mon Sep 17 00:00:00 2001 From: sunjie Date: Thu, 18 Sep 2025 16:27:02 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9badge?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controllers/applet_attendance.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/yuthon_hr_attendance/controllers/applet_attendance.py b/yuthon_hr_attendance/controllers/applet_attendance.py index 58b42edc6..f914faecc 100644 --- a/yuthon_hr_attendance/controllers/applet_attendance.py +++ b/yuthon_hr_attendance/controllers/applet_attendance.py @@ -780,7 +780,9 @@ class AppletAttendance(Controller): 'address': address, 'building': building, 'floor': floor, - 'room': room + 'room': room, + 'epitope_values':electric.epitope_values, + 'unit_number':electric.unit_number, }) # 处理水表 @@ -812,14 +814,16 @@ class AppletAttendance(Controller): 'address': address, 'building': building, 'floor': floor, - 'room': room + 'room': room, + 'epitope_values':water.epitope_values, + 'unit_number':water.unit_number }) # 按“楼盘->楼层”分组 building_floor_map = {} for record in all_records: building_name = record['building'] - floor_name = record['floor'] + floor_name = record['epitope_values'] # 初始化楼盘分组(空楼盘名也作为有效分组) if building_name not in building_floor_map: @@ -830,7 +834,7 @@ class AppletAttendance(Controller): building_floor_map[building_name][floor_name] = [] # 移除building和floor字段,只保留数据项 - record_data = {k: v for k, v in record.items() if k not in ['building', 'floor']} + record_data = {k: v for k, v in record.items() if k not in ['building', 'epitope_values']} building_floor_map[building_name][floor_name].append(record_data) # 组装最终返回结构 From dc6ab7b9d217e14b9089d1167e453cd481681d84 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: Thu, 18 Sep 2025 16:34:08 +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_holiday/models/inherit_hr_leave.py | 22 ++++++++++++++++++++++ yuthon_holiday/views/hr_leave_batch.xml | 3 ++- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/yuthon_holiday/models/inherit_hr_leave.py b/yuthon_holiday/models/inherit_hr_leave.py index 456ec0e79..6fe8fd46b 100644 --- a/yuthon_holiday/models/inherit_hr_leave.py +++ b/yuthon_holiday/models/inherit_hr_leave.py @@ -43,6 +43,28 @@ class HrLeave(models.Model): # if previous_emp_data != emp_data and len(emp_data) >= len(previous_emp_data): # raise ValidationError("您的假期额度不足,无法申请该假期") + leave_hours = fields.Float(string='请假小时', default=0.0) + + @api.onchange('request_hour_from', 'leave_hours') + def _onchange_request_hour_to(self): + if not (self.request_hour_from and self.leave_hours is not None): + self.request_hour_to = False + return + start_hour = float(self.request_hour_from) + leave_hours = float(self.leave_hours) + end_hour = (start_hour + leave_hours) % 24.0 + end_hour_rounded = round(end_hour * 2) / 2 + if end_hour_rounded.is_integer(): + end_hour_key = str(int(end_hour_rounded)) + else: + end_hour_key = str(end_hour_rounded) + + selection_keys = [k for k, v in self._fields['request_hour_to'].selection] + if end_hour_key in selection_keys: + self.request_hour_to = end_hour_key + else: + self.request_hour_to = False + def action_leave_wizard(self): return { diff --git a/yuthon_holiday/views/hr_leave_batch.xml b/yuthon_holiday/views/hr_leave_batch.xml index b271b1773..8d0f8ff7a 100644 --- a/yuthon_holiday/views/hr_leave_batch.xml +++ b/yuthon_holiday/views/hr_leave_batch.xml @@ -133,6 +133,7 @@ 'holiday_status_id_default_request_unit': 'hour' }"> + @@ -163,7 +164,7 @@ - +