summaryrefslogtreecommitdiff
path: root/addons/hr_org_chart/controllers/hr_org_chart.py
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2017-10-13 13:13:11 +0200
committerChristophe Simonis <chs@odoo.com>2017-10-13 13:13:11 +0200
commit1da064a1d34b48ff23d8cdf5a1c189c8bbb4eb64 (patch)
treed832553531790ca342cda3b03e6c44097717ff43 /addons/hr_org_chart/controllers/hr_org_chart.py
parent119ae9b5dcaea577bfd91b36565b764990b9de02 (diff)
parent8ee9024a4c888647df9e18861fe5e58b68947469 (diff)
[MERGE] forward port branch saas-16 up to 8ee9024a4c8
Diffstat (limited to 'addons/hr_org_chart/controllers/hr_org_chart.py')
-rw-r--r--addons/hr_org_chart/controllers/hr_org_chart.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/addons/hr_org_chart/controllers/hr_org_chart.py b/addons/hr_org_chart/controllers/hr_org_chart.py
index a088bb86663..5729997636f 100644
--- a/addons/hr_org_chart/controllers/hr_org_chart.py
+++ b/addons/hr_org_chart/controllers/hr_org_chart.py
@@ -10,12 +10,13 @@ class HrOrgChartController(http.Controller):
_managers_level = 2 # FP request
def _prepare_employee_data(self, employee):
+ job = employee.sudo().job_id
return dict(
id=employee.id,
name=employee.name,
link='/mail/view?model=hr.employee&res_id=%s' % employee.id,
- job_id=employee.job_id.id,
- job_name=employee.job_id.name or '',
+ job_id=job.id,
+ job_name=job.name or '',
direct_sub_count=len(employee.child_ids),
indirect_sub_count=employee.child_all_count,
)