添加功能
This commit is contained in:
@@ -322,6 +322,13 @@ class GoApprovals(models.Model):
|
||||
('vacation_date', '=', month_first)
|
||||
], limit=1)
|
||||
|
||||
if not reports_id:
|
||||
reports_id = self.env['yuthon.vacation.reports'].create({
|
||||
'employee_id': self.users_id.employee_ids.id,
|
||||
'vacation_date': month_first,
|
||||
})
|
||||
reports_id.vacation_state = 'not_sent'
|
||||
|
||||
# 如果当月考勤确认单已确认,则将数据加到下个月的确认单
|
||||
if reports_id and reports_id.vacation_state == 'confirmed':
|
||||
next_month_first = month_first + relativedelta(months=1)
|
||||
|
||||
@@ -423,7 +423,7 @@ class OvertimeApprovals(models.Model):
|
||||
self.allocation_id.sudo().action_validate()
|
||||
# 创建日志
|
||||
if self.start_time:
|
||||
start_date = fields.Datetime.from_string(self.start_time).date()
|
||||
start_date = fields.Datetime.from_string(self.start_time + timedelta(hours=8)).date()
|
||||
vacation_date = start_date.replace(day=1)
|
||||
reports_id = self.env['yuthon.vacation.reports'].search([
|
||||
('employee_id', '=', employee_id.id),
|
||||
|
||||
Reference in New Issue
Block a user