diff --git a/app_user_admin/__manifest__.py b/app_user_admin/__manifest__.py
index eb104b7a2..71a59ee82 100644
--- a/app_user_admin/__manifest__.py
+++ b/app_user_admin/__manifest__.py
@@ -54,7 +54,6 @@
'images': ['static/description/banner.png'],
'depends': [
'web',
- 'hr',
],
'summary': '''
Easy setup user role base on multi security groups.
diff --git a/app_user_admin/models/res_users.py b/app_user_admin/models/res_users.py
index 657c196d5..9518b552e 100644
--- a/app_user_admin/models/res_users.py
+++ b/app_user_admin/models/res_users.py
@@ -59,27 +59,6 @@ class ResUsers(models.Model):
If no role is defined on the user, its groups are let untouched unless
the `force` parameter is `True`.
"""
- # 定义受保护的群组,这些群组不会被角色自动添加或移除
- protected_group_refs = [
- # 财务相关群组
- 'account.group_account_manager',
- 'account.group_account_invoice',
- 'account.group_account_user',
- 'account.group_readonly',
- # 薪资相关群组
- 'hr_payroll.group_hr_payroll_manager',
- 'hr_payroll.group_hr_payroll_user',
- 'yuthon_salary.group_jtbb_user',
- 'yuthon_salary.group_wg_user',
- 'yuthon_salary.group_lc_user',
- 'yuthon_salary.salary_rule_confirm_group',
- ]
- protected_group_ids = []
- for ref in protected_group_refs:
- group = self.env.ref(ref, raise_if_not_found=False)
- if group:
- protected_group_ids.append(group.id)
-
role_groups = {}
# We obtain all the groups associated to each role first, so that
# it is faster to compare later with each user's groups.
@@ -99,15 +78,8 @@ class ResUsers(models.Model):
role = role_line.role_id
group_ids += role_groups[role]
group_ids = list(set(group_ids)) # Remove duplicates IDs
-
- # 移除受保护的群组,不让角色管理它们
- group_ids = [gid for gid in group_ids if gid not in protected_group_ids]
-
- # 获取用户当前非受保护的群组
- user_non_protected_groups = [g.id for g in user.groups_id if g.id not in protected_group_ids]
-
- groups_to_add = list(set(group_ids) - set(user_non_protected_groups))
- groups_to_remove = list(set(user_non_protected_groups) - set(group_ids))
+ groups_to_add = list(set(group_ids) - set(user.groups_id.ids))
+ groups_to_remove = list(set(user.groups_id.ids) - set(group_ids))
to_add = [(4, gr) for gr in groups_to_add]
to_remove = [(3, gr) for gr in groups_to_remove]
groups = to_remove + to_add
diff --git a/yuthon_base/models/res_users.py b/yuthon_base/models/res_users.py
index cb9cbc587..1b6258354 100644
--- a/yuthon_base/models/res_users.py
+++ b/yuthon_base/models/res_users.py
@@ -15,18 +15,9 @@ class ResUsers(models.Model):
# 新建用户后确保移除财务和薪资管理员权限组
groups_to_remove = []
group_refs = [
- # 财务相关群组
'account.group_account_manager',
'account.group_account_invoice',
- 'account.group_account_user',
- 'account.group_readonly',
- # 薪资相关群组
'hr_payroll.group_hr_payroll_manager',
- 'hr_payroll.group_hr_payroll_user',
- 'yuthon_salary.group_jtbb_user', # 集团本部用户
- 'yuthon_salary.group_wg_user', # 物管公司用户
- 'yuthon_salary.group_lc_user', # 粮储公司用户
- 'yuthon_salary.salary_rule_confirm_group', # 工资批次确认
]
for ref in group_refs:
group = self.env.ref(ref, raise_if_not_found=False)
diff --git a/yuthon_property_approval/views/property_lease_contract.xml b/yuthon_property_approval/views/property_lease_contract.xml
index a5893849e..f822a4b56 100644
--- a/yuthon_property_approval/views/property_lease_contract.xml
+++ b/yuthon_property_approval/views/property_lease_contract.xml
@@ -94,7 +94,7 @@
-
+