添加功能

This commit is contained in:
李鹏宇
2025-12-04 14:44:56 +08:00
parent 0e6404fac0
commit f4b6aaaecd
@@ -116,11 +116,11 @@ class HrAttendanceDetail(models.Model):
all_dept_ids = get_all_upper_depts(employee.department_id)
if not is_resource_user:
slot_start = datetime.combine(current_data, datetime.min.time())
slot_end = datetime.combine(current_data + timedelta(days=1), datetime.min.time())
slot_start = datetime.combine(current_data, datetime.min.time()) - timedelta(hours=8)
slot_end = datetime.combine(current_data + timedelta(days=1), datetime.min.time()) - timedelta(hours=8)
# 查找员工对应的班次
planning_slots = self.env['planning.slot'].search([
('employee_id', '=', employee.id),
('resource_id', '=', employee.resource_id.id),
('start_datetime', '>=', slot_start),
('start_datetime', '<', slot_end),
], limit=1)