@@ -153,6 +153,8 @@ class YuthonOnboardApproval(models.Model):
|
||||
'identification_id':login_id.id_card,
|
||||
'mobile_phone': login_id.phone,
|
||||
'marital': marital,
|
||||
'entry_date': self.onboard_time,
|
||||
'work_phone': login_id.phone,
|
||||
'work_email': login_id.email,
|
||||
'job_id': self.job_id.id,
|
||||
'department_id': self.department_id1.id
|
||||
@@ -161,12 +163,28 @@ class YuthonOnboardApproval(models.Model):
|
||||
salary = self.salary
|
||||
else:
|
||||
salary = self.salary_level
|
||||
contract_type_dict = {
|
||||
'labor': '劳务协议',
|
||||
'internship': '实习协议',
|
||||
'part_time': '兼职协议',
|
||||
'consultant': '顾问',
|
||||
'outsourcing': '外包',
|
||||
}
|
||||
if self.employment_form == 'informal':
|
||||
contract_type_id = self.env['hr.contract.type'].search([('name', '=', contract_type_dict.get(self.contract_type))], limit=1)
|
||||
if not contract_type_id:
|
||||
contract_type_id = self.env['hr.contract.type'].create({
|
||||
'name': contract_type_dict.get(self.contract_type),
|
||||
})
|
||||
else:
|
||||
contract_type_id = self.env['hr.contract.type'].search([('name', '=', '正式合同(一签)')], limit=1)
|
||||
self.env['hr.contract'].create({
|
||||
'wage': salary,
|
||||
'job_id': self.job_id.id,
|
||||
'department_id': self.department_id1.id,
|
||||
'employee_id': employee_id.id,
|
||||
'date_start': self.duration_employment,
|
||||
'contract_type_id': contract_type_id.id,
|
||||
'structure_type_id': self.structure_type_id.id,
|
||||
'is_annual_salary': self.is_annual_salary,
|
||||
'date_end': self.duration_employment_end,
|
||||
|
||||
Reference in New Issue
Block a user