diff --git a/yuthon_hr_employee/__manifest__.py b/yuthon_hr_employee/__manifest__.py
index cdabd4f59..722fb0e5f 100644
--- a/yuthon_hr_employee/__manifest__.py
+++ b/yuthon_hr_employee/__manifest__.py
@@ -11,13 +11,15 @@
'license': 'LGPL-3',
'author': 'pengyuthon',
'website': 'https://www.pengyuthon.com',
- 'depends': ['base', 'hr', 'hr_recruitment'],
+ 'depends': ['base', 'hr', 'hr_recruitment','soong_workflow'],
'data': [
'data/yuthon.job.lv.csv',
+ 'data/job_lv_groups_data.xml',
'data/employee_code_data.xml',
'data/applicant_tage_setting_data.xml',
'data/publish_applicant_setting_data.xml',
'security/ir.model.access.csv',
+ 'security/job_lv_security_group.xml',
'views/yuthon_hr_employee_views.xml',
'views/yuthon_hr_department_views.xml',
'views/yuthon_job_lv_views.xml',
diff --git a/yuthon_hr_employee/data/job_lv_groups_data.xml b/yuthon_hr_employee/data/job_lv_groups_data.xml
new file mode 100644
index 000000000..ba2a7d610
--- /dev/null
+++ b/yuthon_hr_employee/data/job_lv_groups_data.xml
@@ -0,0 +1,19 @@
+
+
+
+ 职级管理员
+ departmental_role
+
+
+ 天河投资职级
+ departmental_role
+
+
+ 天河物管职级
+ departmental_role
+
+
+ 天河粮储职级
+ departmental_role
+
+
\ No newline at end of file
diff --git a/yuthon_hr_employee/models/__init__.py b/yuthon_hr_employee/models/__init__.py
index 6511d7071..0059c0c63 100644
--- a/yuthon_hr_employee/models/__init__.py
+++ b/yuthon_hr_employee/models/__init__.py
@@ -8,5 +8,5 @@ from . import inherit_hr_applicant
from . import applicant_tage_setting
from . import publish_applicant_setting
from . import yuthon_job_postings
-
+from . import inherit_hr_employee
diff --git a/yuthon_hr_employee/models/inherit_hr_employee.py b/yuthon_hr_employee/models/inherit_hr_employee.py
new file mode 100644
index 000000000..62c3156cd
--- /dev/null
+++ b/yuthon_hr_employee/models/inherit_hr_employee.py
@@ -0,0 +1,29 @@
+# -*- coding: utf-8 -*-
+from odoo import api, fields, models
+
+
+class YuthonHrEmployee(models.Model):
+ _inherit = "hr.employee"
+
+ user_role_ids_changed = fields.Boolean(compute='_compute_user_roles')
+
+ @api.depends('user_role_ids')
+ def _compute_job_lv_roles(self):
+ group_mapping = {
+ '职级管理员': 'group_topic_admin',
+ '天河投资职级': 'group_party_topic',
+ '天河物管职级': 'group_team_topic',
+ '天河粮储职级': 'group_board_topic',
+ }
+
+ old_users_ids = self.user_role_ids
+ for employee in self:
+ for role in employee.user_role_ids:
+ group_id = group_mapping.get(role.name)
+ if group_id:
+ group = self.env.ref('yuthon_issue.' + group_id, raise_if_not_found=False)
+ if group:
+ # 未知因素屏蔽选择值
+ group.write({'users': [(4, employee.user_id.id)]})
+ self.user_role_ids = old_users_ids
+ self.user_role_ids_changed = True
diff --git a/yuthon_hr_employee/models/yuthon_job_lv.py b/yuthon_hr_employee/models/yuthon_job_lv.py
index c439bfc16..d4918ae06 100644
--- a/yuthon_hr_employee/models/yuthon_job_lv.py
+++ b/yuthon_hr_employee/models/yuthon_job_lv.py
@@ -9,7 +9,7 @@ class YuthonJobLv(models.Model):
_description = "职级管理"
_order = 'lv desc'
- lv = fields.Integer(string="级别")
+ lv = fields.Char(string="级别")
name = fields.Char(string="职级名称")
base_wage = fields.Float(string="基本工资")
job_wage = fields.Float(string="职级工资")
diff --git a/yuthon_hr_employee/security/ir.model.access.csv b/yuthon_hr_employee/security/ir.model.access.csv
index 040fe2fe2..92d70edfa 100644
--- a/yuthon_hr_employee/security/ir.model.access.csv
+++ b/yuthon_hr_employee/security/ir.model.access.csv
@@ -1,5 +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_job_lv,yuthon_job_lv,model_yuthon_job_lv,,1,1,1,1
access_hr_job_type,hr_job_type,model_hr_job_type,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
access_yuthon_emergency_contact_line,yuthon_emergency_contact_line,model_yuthon_emergency_contact_line,base.group_user,1,1,1,1
@@ -11,4 +11,4 @@ access_yuthon_directly_detail_lines,yuthon_directly_detail_lines,model_yuthon_di
access_yuthon_recent_work_detail_line,yuthon_recent_work_detail_line,model_yuthon_recent_work_detail_line,base.group_user,1,1,1,1
access_publish_applicant_setting,publish_applicant_setting,model_publish_applicant_setting,base.group_user,1,1,1,1
access_applicant_tage_setting,applicant_tage_setting,model_applicant_tage_setting,base.group_user,1,1,1,1
-access_yuthon_job_postings,yuthon_job_postings,model_yuthon_job_postings,base.group_user,1,1,1,1
\ No newline at end of file
+access_yuthon_job_postings,yuthon_job_postings,model_yuthon_job_postings,base.group_user,1,1,1,1
diff --git a/yuthon_hr_employee/security/job_lv_security_group.xml b/yuthon_hr_employee/security/job_lv_security_group.xml
new file mode 100644
index 000000000..0f4dab1e2
--- /dev/null
+++ b/yuthon_hr_employee/security/job_lv_security_group.xml
@@ -0,0 +1,30 @@
+
+
+
+ 职级权限
+
+
+
+ 天河投资职级
+
+
+
+
+ 天河物管职级
+
+
+
+
+
+ 天河粮储职级
+
+
+
+
+ 职级管理员
+
+
+
+
+
diff --git a/yuthon_hr_employee/views/yuthon_job_lv_views.xml b/yuthon_hr_employee/views/yuthon_job_lv_views.xml
index 95301b2e7..3c86d403f 100644
--- a/yuthon_hr_employee/views/yuthon_job_lv_views.xml
+++ b/yuthon_hr_employee/views/yuthon_job_lv_views.xml
@@ -1,14 +1,11 @@
-
+
yuthon.job.lv.tree
yuthon.job.lv
-
-
-
@@ -45,11 +42,126 @@
tree
{'search_default_group_company': True, 'search_default_group_lv': True}
-
+
+
+ yuthon.job.lv.tree
+ yuthon.job.lv
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 职级管理
+ yuthon.job.lv
+ tree
+ [('yuthon_company', '=', 'tz')]
+
+ {'search_default_group_company': True, 'search_default_group_lv': True}
+
+
+
+ yuthon.job.lv.tree
+ yuthon.job.lv
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 职级管理
+ yuthon.job.lv
+ tree
+ [('yuthon_company', '=', 'wg')]
+
+ {'search_default_group_company': True, 'search_default_group_lv': True}
+
+
+
+ yuthon.job.lv.tree
+ yuthon.job.lv
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 职级管理
+ yuthon.job.lv
+ tree
+ [('yuthon_company', '=', 'thlc')]
+
+ {'search_default_group_company': True, 'search_default_group_lv': True}
+
+
+
+
+
+
\ No newline at end of file