diff --git a/yuthon_hr_employee/models/yuthon_hr_employee.py b/yuthon_hr_employee/models/yuthon_hr_employee.py index 39ed1cb5f..a998e85a7 100644 --- a/yuthon_hr_employee/models/yuthon_hr_employee.py +++ b/yuthon_hr_employee/models/yuthon_hr_employee.py @@ -965,7 +965,14 @@ class YuthonHrEmployee(models.Model): ('text','=', '育儿假分配') ], limit=1) if not parenting_line_ids: - reports_id.sudo().write({'parenting_line_ids': parenting_line_ids}) + reports_id.parenting_line_ids.sudo().create({ + 'vacation_id': reports_id.id, + 'employee_id': employee.id, + 'update_date': date_from, + 'lines': total_days, + 'end_date': date_to, + 'text': '育儿假分配' + }) self.env['hr.leave.allocation'].create({ 'name': '育儿假分配',