From 0cff501a99605405c6d9c5daca16810117bed826 Mon Sep 17 00:00:00 2001 From: zhou <123@> Date: Wed, 6 Aug 2025 10:03:31 +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 | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/yuthon_hr_attendance/models/yuthon_vacation_reports.py b/yuthon_hr_attendance/models/yuthon_vacation_reports.py index 9479eeda1..9a8273f38 100644 --- a/yuthon_hr_attendance/models/yuthon_vacation_reports.py +++ b/yuthon_hr_attendance/models/yuthon_vacation_reports.py @@ -22,8 +22,8 @@ class YuthonVacationReports(models.Model): other_fee_ids = fields.One2many('vacation.other.line', 'vacation_id', string='其他明细') vacation_date = fields.Date(string='日期', default=lambda self: fields.Date.today()) - leave = fields.Char(string='年假', compute='_compute_leave', store=True, digits=(16, 3)) - working_overtime = fields.Char(string='加班时', compute='_compute_working_overtime', store=True, digits=(16, 3)) + leave = fields.Float(string='年假', compute='_compute_leave', store=True, digits=(16, 3)) + working_overtime = fields.Float(string='加班时', compute='_compute_working_overtime', store=True, digits=(16, 3)) meal_fee = fields.Integer(string="误餐次数", compute='_compute_meal_fee', store=True) medical_fee = fields.Float(string="体检费", compute='_compute_medical_fee', store=True) compensatory_leave = fields.Integer(string="调休") @@ -216,8 +216,7 @@ class YuthonVacationReports(models.Model): leave_hours += line_value elif line.update_type == 'reduce': leave_hours -= line_value - leave_days = leave_hours / 8 - record.leave = f"{leave_days:.3f}" + record.leave = leave_hours / 8 overtime_hours = 0.0 for line in record.overtime_ids: @@ -227,8 +226,7 @@ class YuthonVacationReports(models.Model): overtime_hours += line_total elif line.update_type == 'reduce': overtime_hours -= line_total - overtime_days = overtime_hours / 8 - record.working_overtime = f"{overtime_days:.3f}" + record.working_overtime = overtime_hours / 8 def vacation_delete(self): vacation_ids = self.env["yuthon.vacation.reports"].browse( @@ -267,8 +265,7 @@ class YuthonVacationReports(models.Model): elif line.update_type == 'reduce': leave_hours -= line_value - leave_days = leave_hours / 8 - record.leave = f"{leave_days:.2f}" + record.leave = leave_hours / 8 @api.depends( 'overtime_ids.workday', @@ -287,8 +284,7 @@ class YuthonVacationReports(models.Model): overtime_hours += line_total elif line.update_type == 'reduce': overtime_hours -= line_total - overtime_days = overtime_hours / 8 - record.working_overtime = f"{overtime_days:.2f}" + record.working_overtime = overtime_hours / 8 @api.depends('meal_fee_ids.update_lines', 'meal_fee_ids.update_type', 'meal_fee_ids.is_void') def _compute_meal_fee(self):