From 3048c1f977b3e327b1c214747f361bdd9701bb67 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, 8 Dec 2025 16:03:03 +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 --- .../models/yuthon_vacation_reports.py | 33 +------------------ .../views/inherit_yuthon_property_views.xml | 6 ++-- yuthon_report/models/receivable_report.py | 14 +++++--- .../yuthon_report/receivable_report.js | 14 ++++---- .../yuthon_report/receivable_report.xml | 2 +- .../components/yuthon_report/yuthon_report.js | 2 +- 6 files changed, 23 insertions(+), 48 deletions(-) diff --git a/yuthon_hr_attendance/models/yuthon_vacation_reports.py b/yuthon_hr_attendance/models/yuthon_vacation_reports.py index bea4dd5bb..4554c4f2d 100644 --- a/yuthon_hr_attendance/models/yuthon_vacation_reports.py +++ b/yuthon_hr_attendance/models/yuthon_vacation_reports.py @@ -132,38 +132,7 @@ class YuthonVacationReports(models.Model): def confirm_state(self): for rec in self: - rec.vacation_state = 'confirmed' - # 计算下个月的日期(基于当前记录的vacation_date) - current_date = rec.vacation_date - if current_date.month == 12: - next_month_date = current_date.replace(year=current_date.year + 1, month=1, day=1) - else: - next_month_date = current_date.replace(month=current_date.month + 1, day=1) - # 查找下个月是否已有该员工的记录 - next_month_record = self.search([ - ('employee_id', '=', rec.employee_id.id), - ('vacation_date', '=', next_month_date) - ], limit=1) - - inherit_vals = { - 'leave': rec.leave, - 'working_overtime': rec.working_overtime, - 'medical_fee': rec.medical_fee, - } - if next_month_record: - # 如果下个月记录已存在,更新继承字段 - next_month_record.write(inherit_vals) - - # 处理年假明细行继承 - if rec.leave: - leave_hours = rec.leave * 8 - self._update_leave_lines(next_month_record, [rec], leave_hours) - - # 处理补休明细行继承 - if rec.working_overtime: - overtime_hours = rec.working_overtime * 8 - self._update_over_lines(next_month_record, [rec], overtime_hours) - + rec.manage_reject() @api.depends('vacation_date') def _compute_display_date(self): diff --git a/yuthon_property_approval/views/inherit_yuthon_property_views.xml b/yuthon_property_approval/views/inherit_yuthon_property_views.xml index 48c802a89..e119c8238 100644 --- a/yuthon_property_approval/views/inherit_yuthon_property_views.xml +++ b/yuthon_property_approval/views/inherit_yuthon_property_views.xml @@ -396,7 +396,8 @@