@@ -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):
|
||||
|
||||
@@ -14,6 +14,7 @@ class PropertyOpenRent(models.Model):
|
||||
_rec_name = 'name'
|
||||
|
||||
name = fields.Char(string='标题')
|
||||
user_id = fields.Many2one('res.users', string='申请人', default=lambda self: self.env.user.id)
|
||||
code = fields.Char(string="编号", default=lambda self: self.env['ir.sequence'].next_by_code('property_open_rent_code'))
|
||||
property_documents_ids = fields.Many2many('documents.document', string="物业公开招租文件")
|
||||
rental_area = fields.Float(string="出租面积")
|
||||
|
||||
Reference in New Issue
Block a user