[FIX] hr_org_chart: Compute non-stored fields in superuser mode

closes odoo/odoo#39428

X-original-commit: 1f2ff1e93b6fcbf2d6a2153465aa81852cc65816
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
This commit is contained in:
Swapnesh Shah
2019-10-28 11:10:47 +00:00
committed by fw-bot
parent 596b246f93
commit 5fef9d27d0
2 changed files with 6 additions and 3 deletions
+4 -2
View File
@@ -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)
@@ -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):
"""