添加功能
This commit is contained in:
@@ -512,16 +512,16 @@ class OvertimeApprovals(models.Model):
|
||||
'workflow_id': workflow_id.id,
|
||||
})
|
||||
|
||||
|
||||
@api.depends('users_id', 'duration', 'start_time', 'end_time')
|
||||
@api.depends('employee_ids', 'duration', 'start_time', 'end_time')
|
||||
def _compute_name(self):
|
||||
for rec in self:
|
||||
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 + timedelta(hours=8)).strftime('%H:%M') if rec.end_time else '无'
|
||||
employee_names = '、'.join(rec.employee_ids.mapped('name')) if rec.employee_ids else '未知'
|
||||
if rec.duration == 0:
|
||||
rec.name = f"{rec.users_id.name}加班 {start_time_str}-{end_time_str}"
|
||||
rec.name = f"{employee_names} 加班 {start_time_str}-{end_time_str}"
|
||||
else:
|
||||
rec.name = f"{rec.users_id.name}加班{start_time_str}-{end_time_str},共{rec.duration}小时 "
|
||||
rec.name = f"{employee_names} 加班{start_time_str}-{end_time_str},共{rec.duration}小时"
|
||||
|
||||
@api.depends('start_time', 'end_time')
|
||||
def _compute_overtime_type(self):
|
||||
|
||||
Reference in New Issue
Block a user