添加功能

This commit is contained in:
李鹏宇
2026-01-07 18:54:32 +08:00
parent 1ded8d6174
commit 8cb9b6b108
2 changed files with 3 additions and 6 deletions
@@ -208,7 +208,6 @@ class HrLeaveAllocation(models.Model):
'employee_id': reports_id.employee_id.id,
'update_type': 'add',
'valid_date': leave.date_from,
'update_date': fields.Date.today(),
'workday': leave.number_of_hours_display,
'legal_day': 0,
'public_holidays': 0,
@@ -54,7 +54,7 @@ class YuthonVacationReports(models.Model):
compensatory_leave = fields.Integer(string="调休", compute='_compute_other_leave', store=True, group_operator=None)
leave_of_absence = fields.Float(string="事假", digits=(16, 3), compute='_compute_other_leave', store=True,
group_operator=None)
statutory_leave = fields.Integer(string="加班时(法定)", compute='_compute_other_leave', store=True, group_operator=None)
statutory_leave = fields.Integer(string="加班时(法定)", compute='_compute_other_leave', store=True, group_operator=None, digits=(16, 3))
cop_leave = fields.Float(string='补休', digits=(16, 3), store=True, compute='_compute_working_overtime',
group_operator=None)
duty_off_leave = fields.Integer(string='值班调休', compute='_compute_other_leave', store=True, group_operator=None)
@@ -702,7 +702,7 @@ class YuthonVacationReports(models.Model):
if line.is_void:
continue
line_total = (line.workday or 0) + (line.public_holidays or 0) + (line.legal_day or 0)
line_total = (line.workday or 0) + (line.public_holidays or 0)
legal_total += (line.legal_day or 0)
if line.update_type == 'add':
total_add += line_total
@@ -969,11 +969,9 @@ class VacationOverline(models.Model):
vacation_main = self.env['yuthon.vacation.reports'].browse(vals['vacation_id'])
deduct_workday = vals.get('workday', 0.0)
deduct_public = vals.get('public_holidays', 0.0)
deduct_legal = vals.get('legal_day', 0.0)
deduct_workday_convert = deduct_workday / 8
deduct_public_convert = deduct_public / 8
deduct_legal_convert = deduct_legal / 8
deduct_total = deduct_workday_convert + deduct_public_convert + deduct_legal_convert
deduct_total = deduct_workday_convert + deduct_public_convert
if vacation_main:
vacation_used_vals = {
'used_this_year1': (vacation_main.used_this_year1 or 0.0) + deduct_total