diff --git a/addons/hr_org_chart/models/hr_employee.py b/addons/hr_org_chart/models/hr_employee.py index 8d04dd989ec..e3d7c8bb4b1 100644 --- a/addons/hr_org_chart/models/hr_employee.py +++ b/addons/hr_org_chart/models/hr_employee.py @@ -7,10 +7,12 @@ from odoo import fields, models class Employee(models.Model): _inherit = ["hr.employee"] - subordinate_ids = fields.One2many('hr.employee', string='Subordinates', compute='_compute_subordinates', help="Direct and indirect subordinates") + subordinate_ids = fields.One2many('hr.employee', string='Subordinates', compute='_compute_subordinates', help="Direct and indirect subordinates", + compute_sudo=True) class HrEmployeePublic(models.Model): _inherit = ["hr.employee.public"] - subordinate_ids = fields.One2many('hr.employee.public', string='Subordinates', compute='_compute_subordinates', help="Direct and indirect subordinates") + subordinate_ids = fields.One2many('hr.employee.public', string='Subordinates', compute='_compute_subordinates', help="Direct and indirect subordinates", + compute_sudo=True) diff --git a/addons/hr_org_chart/models/hr_org_chart_mixin.py b/addons/hr_org_chart/models/hr_org_chart_mixin.py index 7633f2325ab..e687c51feb0 100644 --- a/addons/hr_org_chart/models/hr_org_chart_mixin.py +++ b/addons/hr_org_chart/models/hr_org_chart_mixin.py @@ -9,7 +9,8 @@ class HrEmployeeBase(models.AbstractModel): child_all_count = fields.Integer( 'Indirect Surbordinates Count', - compute='_compute_subordinates', store=False) + compute='_compute_subordinates', store=False, + compute_sudo=True) def _get_subordinates(self, parents=None): """