From 45df21922a171ec25560f19852ff15b21ffd14a1 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: Wed, 15 Jul 2026 15:26:56 +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/go_approval.py | 7 +++++++ yuthon_hr_attendance/models/overtime_approval.py | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/yuthon_hr_attendance/models/go_approval.py b/yuthon_hr_attendance/models/go_approval.py index 1ba981ec6..cf8649f8a 100644 --- a/yuthon_hr_attendance/models/go_approval.py +++ b/yuthon_hr_attendance/models/go_approval.py @@ -322,6 +322,13 @@ class GoApprovals(models.Model): ('vacation_date', '=', month_first) ], limit=1) + if not reports_id: + reports_id = self.env['yuthon.vacation.reports'].create({ + 'employee_id': self.users_id.employee_ids.id, + 'vacation_date': month_first, + }) + reports_id.vacation_state = 'not_sent' + # 如果当月考勤确认单已确认,则将数据加到下个月的确认单 if reports_id and reports_id.vacation_state == 'confirmed': next_month_first = month_first + relativedelta(months=1) diff --git a/yuthon_hr_attendance/models/overtime_approval.py b/yuthon_hr_attendance/models/overtime_approval.py index 7606e2b07..1e5bb697c 100644 --- a/yuthon_hr_attendance/models/overtime_approval.py +++ b/yuthon_hr_attendance/models/overtime_approval.py @@ -423,7 +423,7 @@ class OvertimeApprovals(models.Model): self.allocation_id.sudo().action_validate() # 创建日志 if self.start_time: - start_date = fields.Datetime.from_string(self.start_time).date() + start_date = fields.Datetime.from_string(self.start_time + timedelta(hours=8)).date() vacation_date = start_date.replace(day=1) reports_id = self.env['yuthon.vacation.reports'].search([ ('employee_id', '=', employee_id.id),