diff --git a/yuthon_contract/models/inherit_hr_contract.py b/yuthon_contract/models/inherit_hr_contract.py index 5b29db925..698dd86b8 100644 --- a/yuthon_contract/models/inherit_hr_contract.py +++ b/yuthon_contract/models/inherit_hr_contract.py @@ -13,7 +13,7 @@ class HrContract(models.Model): resource_calendar_id = fields.Many2one('resource.calendar', string='考勤时间表') date_of_entry = fields.Date(related='employee_id.entry_date', string="入职时间") salary_group_id = fields.Many2one('yuthon.salary.group', string="工资单分组", store=True, index=True) - + is_internship = fields.Boolean(string="实习期", compute='_compute_name', store=True) work_entry_source = fields.Selection([ ('calendar', '考勤安排'), ('attendance', 'Attendances'), @@ -38,6 +38,9 @@ class HrContract(models.Model): record.name = record.employee_id.name + record.contract_type_id.name + '合同' else: record.name = ' ' + if record.contract_type_id: + if record.contract_type_id.name == '实习协议': + record.is_internship = True def action_hr_contract(self): return { diff --git a/yuthon_contract/views/inherit_hr_contract_views.xml b/yuthon_contract/views/inherit_hr_contract_views.xml index 9f0202dd3..08637cbd3 100644 --- a/yuthon_contract/views/inherit_hr_contract_views.xml +++ b/yuthon_contract/views/inherit_hr_contract_views.xml @@ -30,8 +30,9 @@ + - +