diff --git a/yuthon_hr_employee/models/__init__.py b/yuthon_hr_employee/models/__init__.py index 1af45361c..ab56fb14e 100644 --- a/yuthon_hr_employee/models/__init__.py +++ b/yuthon_hr_employee/models/__init__.py @@ -3,3 +3,4 @@ from . import yuthon_job_lv from . import yuthon_user_role from . import yuthon_hr_department from . import inherit_res_user +from . import hr_employee_page diff --git a/yuthon_hr_employee/models/hr_employee_page.py b/yuthon_hr_employee/models/hr_employee_page.py new file mode 100644 index 000000000..523b94df8 --- /dev/null +++ b/yuthon_hr_employee/models/hr_employee_page.py @@ -0,0 +1,18 @@ +# -*- coding: utf-8 -*- +from odoo import api, fields, models, _ + + +class YuthonEmergencyContact(models.Model): + _name = 'yuthon.emergency.contact' + _description = "紧急联系人明细行" + + emergency_contact_id = fields.Many2one('hr.employee', string="关联员工") + user_relationship = fields.Selection([("parents", "父母"), + ("children", "子女"), + ("spouse", "配偶")], string="关系") + workplace = fields.Char(string="工作单位") + post = fields.Char(string="岗位") + phone_number = fields.Char(string="手机号") + home_address = fields.Char(string="家庭住址") + + diff --git a/yuthon_hr_employee/models/yuthon_hr_employee.py b/yuthon_hr_employee/models/yuthon_hr_employee.py index f592e25ed..cfca9617a 100644 --- a/yuthon_hr_employee/models/yuthon_hr_employee.py +++ b/yuthon_hr_employee/models/yuthon_hr_employee.py @@ -91,6 +91,10 @@ class YuthonHrEmployee(models.Model): # 其他信息 employment_registration = fields.Text(string="就业登记办理情况") seniority_prize_pick_up_status = fields.Text(string="工龄相关年功奖领取情况") + + # 紧急联系人 + emergency_contact_ids = fields.One2many('yuthon.emergency.contact', 'emergency_contact_id', string="紧急联系人明细行") + def action_hr_employee(self): return { "type": "ir.actions.act_window", @@ -100,7 +104,6 @@ class YuthonHrEmployee(models.Model): "target": "new", } - @api.onchange('social_insurance_date') def onchange_insurance_time(self): for social in self: diff --git a/yuthon_hr_employee/security/ir.model.access.csv b/yuthon_hr_employee/security/ir.model.access.csv index ecca149d2..a4fcdf7de 100644 --- a/yuthon_hr_employee/security/ir.model.access.csv +++ b/yuthon_hr_employee/security/ir.model.access.csv @@ -1,4 +1,5 @@ id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink access_yuthon_job_lv,yuthon_job_lv,model_yuthon_job_lv,base.group_user,1,1,1,1 access_yuthon_user_role,yuthon_user_role,model_yuthon_user_role,base.group_user,1,1,1,1 -access_yuthon_hr_employee_wizard,yuthon_hr_employee_wizard,model_yuthon_hr_employee_wizard,base.group_user,1,1,1,1 \ No newline at end of file +access_yuthon_hr_employee_wizard,yuthon_hr_employee_wizard,model_yuthon_hr_employee_wizard,base.group_user,1,1,1,1 +access_yuthon_emergency_contact,yuthon_emergency_contact,model_yuthon_emergency_contact,base.group_user,1,1,1,1 \ No newline at end of file diff --git a/yuthon_hr_employee/views/yuthon_hr_employee_views.xml b/yuthon_hr_employee/views/yuthon_hr_employee_views.xml index b37d3b8a7..6b8f2b8e9 100644 --- a/yuthon_hr_employee/views/yuthon_hr_employee_views.xml +++ b/yuthon_hr_employee/views/yuthon_hr_employee_views.xml @@ -153,10 +153,20 @@ + + + + + + + + + + + + - -