@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user