Merge pull request !10901 from dev
This commit is contained in:
李鹏宇
2026-04-16 02:39:17 +00:00
committed by Gitee
@@ -190,12 +190,9 @@ class VacationOvertimeActive(models.Model):
('carryover_type', '=', 'leave'),
('leave_id.start_date', '>', last_day),
]
# 1. 先查询,计算总和
records = self.env['overtime.carryover'].search(original_domain)
total = sum(r.carry_forward_quantity for r in records)
if math.isclose(total, self.carry_forward_quantity, abs_tol=1e-9):
if math.isclose(total, self.carry_forward_quantity, abs_tol=0.1):
final_domain = original_domain
else:
final_domain = [
@@ -216,3 +213,15 @@ class VacationOvertimeActive(models.Model):
'domain': final_domain,
'target': 'current',
}
# 打开视图
view_id = self.env.ref('yuthon_hr_attendance.view_overtime_carryover_tree1').id
return {
'name': f'加班明细',
'type': 'ir.actions.act_window',
'res_model': 'overtime.carryover',
'view_mode': 'tree',
'view_id': view_id,
'domain': final_domain,
'target': 'current',
}