diff --git a/yuthon_issue/models/issue_library.py b/yuthon_issue/models/issue_library.py index f6789efd7..81c121293 100644 --- a/yuthon_issue/models/issue_library.py +++ b/yuthon_issue/models/issue_library.py @@ -656,9 +656,11 @@ class IssueLibrary(models.Model): # 生成议题明细,根据是否含党字设置 is_sanda for issue in issue_active_ids: - dept_manager = self.env['hr.employee'].search([ + dept_manager = self.env['hr.employee'].sudo().search([ ('active', '=', True), + '|', ('user_role_id.name', '=', '部门经理'), + ('user_role_ids.name', '=', '部门经理'), '|', ('department_id', '=', issue.department_id.id), ('department_ids', 'in', [issue.department_id.id]) @@ -715,13 +717,17 @@ class IssueLibrary(models.Model): target_managers = self.env['hr.employee'].search([ ('company_id', '=', current_user.company_id.id), ('department_id.name', 'in', target_dept_names), + ('active', '=', True), + '|', ('user_role_id.name', '=', '部门经理'), - ('active', '=', True) + ('user_role_ids.name', '=', '部门经理'), ]) manager_employee = self.env['hr.employee'].search([ ('id', 'in', target_managers.ids), - ('user_role_id.name', '=', '部门经理') + '|', + ('user_role_id.name', '=', '部门经理'), + ('user_role_ids.name', '=', '部门经理') ], limit=1) attendees_ids = []