Merge pull request !11195 from 李鹏宇/dev
This commit is contained in:
李鹏宇
2026-04-27 08:55:43 +00:00
committed by Gitee
2 changed files with 5 additions and 4 deletions
@@ -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="出租面积")