From d361dca5c3dcd876351082ed63cbe6814fe0c30c Mon Sep 17 00:00:00 2001 From: zhou <123@> Date: Mon, 21 Apr 2025 17:14:40 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- yuthon_contract/models/inherit_hr_contract.py | 5 ++++- yuthon_contract/views/inherit_hr_contract_views.xml | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) 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 @@ + - +