diff --git a/yuthon_hr_employee/models/yuthon_hr_employee.py b/yuthon_hr_employee/models/yuthon_hr_employee.py index af39090d4..3893f8a61 100644 --- a/yuthon_hr_employee/models/yuthon_hr_employee.py +++ b/yuthon_hr_employee/models/yuthon_hr_employee.py @@ -38,6 +38,7 @@ class YuthonHrEmployee(models.Model): ('formal_none', '正式合同(无固定)'), ('part_time', '兼职协议'), ('employment', '用工协议'), ('internship', '实习协议')], string="用工形式") contract_type_id = fields.Many2one(related='contract_id.contract_type_id', string="用工形式") + party_id = fields.Many2one(related='contract_id.party_id', string="甲方(用人单位)", store=True) date_end = fields.Date(string="合同结束日期", compute='_compute_date_end') # version = fields.Char(related='contract_id.version', string="版本") end_comparison = fields.Selection([('red', '小于30天'), ('yellow', '小于60天'), ('blue', '小于90天')], string="结束时间对比(颜色)", @@ -78,6 +79,18 @@ class YuthonHrEmployee(models.Model): bank_account = fields.Char(string="银行卡号") user_location_type = fields.Selection([('formal', '本地农业'), ('labor', '本地非农业'), ('part_time', '外地农业'), ('practice', '外地非农业')], string="户籍类型") + is_local_location = fields.Char( + string="是否外地", + compute='_compute_is_local_location', + ) + + @api.depends('user_location_type') + def _compute_is_local_location(self): + for rec in self: + if rec.user_location_type in ('formal', 'labor'): + rec.is_local_location = '否' + else: + rec.is_local_location = '是' duty_replacement_card = fields.Integer(string="值班补卡次数(月)") # 工作信息 entry_date = fields.Date(string="入职日期") diff --git a/yuthon_hr_employee/views/yuthon_hr_employee_views.xml b/yuthon_hr_employee/views/yuthon_hr_employee_views.xml index 807ccc0b3..f6c83c259 100644 --- a/yuthon_hr_employee/views/yuthon_hr_employee_views.xml +++ b/yuthon_hr_employee/views/yuthon_hr_employee_views.xml @@ -594,6 +594,9 @@ + + +