diff --git a/yuthon_hr_attendance/models/hr_attendance_detail_wechat.py b/yuthon_hr_attendance/models/hr_attendance_detail_wechat.py index 62fdbf426..05be98727 100644 --- a/yuthon_hr_attendance/models/hr_attendance_detail_wechat.py +++ b/yuthon_hr_attendance/models/hr_attendance_detail_wechat.py @@ -293,6 +293,8 @@ class HrAttendanceDetail(models.Model): template_domain.append(('planning_name', '=', planning_name)) template_domain.append(('department_id', 'in', all_dept_ids)) template = self.env['planning.slot.template'].search(template_domain, limit=1) + if not planning_slots: + template = None if not template: role_templates = [