From 1906848fa8e20a90e8605b09bf2636ccecbbf6cb 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, 4 Mar 2026 15:30:28 +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 | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/yuthon_hr_attendance/models/yuthon_vacation_reports.py b/yuthon_hr_attendance/models/yuthon_vacation_reports.py index 39d3eb1c4..141d3d3f1 100644 --- a/yuthon_hr_attendance/models/yuthon_vacation_reports.py +++ b/yuthon_hr_attendance/models/yuthon_vacation_reports.py @@ -113,7 +113,7 @@ class YuthonVacationReports(models.Model): default='not_sent') @api.depends('vacation_date', 'employee_id') - def _compute_number_card(self): + def compute_number_card(self): for record in self: count = 0 if not record.employee_id or not record.vacation_date: @@ -2099,14 +2099,16 @@ class VacationOverline(models.Model): res_model = rec.workflow_record_id.res_model res_id = rec.workflow_record_id.res_id if res_model and res_id and res_model in self.env: - overtime_id = rec.env[res_model].search([('id', '=', res_id)], limit=1) - if overtime_id: - rec.reason_application = overtime_id.reason_application - rec.overtime_name = overtime_id.name or '' - rec.start_time = overtime_id.start_time or '' - rec.end_time = overtime_id.end_time or '' - rec.duration = overtime_id.duration or 0 - rec.workflow_id = rec.workflow_record_id.workflow_id.id or False + if res_model == 'overtime.approval': + overtime_id = rec.env[res_model].search([('id', '=', res_id)], limit=1) + if overtime_id: + rec.meal = overtime_id.meal + rec.reason_application = overtime_id.reason_application + rec.overtime_name = overtime_id.name or '' + rec.start_time = overtime_id.start_time or '' + rec.end_time = overtime_id.end_time or '' + rec.duration = overtime_id.duration or 0 + rec.workflow_id = rec.workflow_record_id.workflow_id.id or False def action_void(self): self.is_void = True