!6875 添加功能

Merge pull request !6875 from 李鹏宇/dev_zhou
This commit is contained in:
李鹏宇
2025-12-05 08:15:50 +00:00
committed by Gitee
@@ -314,8 +314,8 @@ class OvertimeApprovals(models.Model):
@api.depends('users_id', 'duration', 'start_time', 'end_time')
def _compute_name(self):
for rec in self:
start_time_str = rec.start_time.strftime('%Y-%m-%d %H:%M') if rec.start_time else '无'
end_time_str = rec.end_time.strftime('%H:%M') if rec.end_time else '无'
start_time_str = (rec.start_time + timedelta(hours=8)).strftime('%Y-%m-%d %H:%M') if rec.start_time else '无'
end_time_str = (rec.end_time.strftime+ timedelta(hours=8))('%H:%M') if rec.end_time else '无'
if rec.duration == 0:
rec.name = f"{rec.users_id.name}加班 {start_time_str}-{end_time_str}"
else: