From e092060dfeea1eeba852e06106fe66f147cacd00 Mon Sep 17 00:00:00 2001 From: Shreya Modi Date: Fri, 14 Jun 2019 06:46:49 +0000 Subject: [PATCH] [FIX] hr_org_chart: Fix traceback on employee creation While creating employee and selecting a company other than the current company, saving record shows a traceback. Currently xml template expects managers and children key returned from /get_org_chart controller but /get_org_chart was returning blank dict, and which is used as qweb context to render template. Return {'managers': [], 'children': []} if _check_employee returns False task-2000269 --- addons/hr_org_chart/controllers/hr_org_chart.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/addons/hr_org_chart/controllers/hr_org_chart.py b/addons/hr_org_chart/controllers/hr_org_chart.py index fb389f6bb51..35e1988821b 100644 --- a/addons/hr_org_chart/controllers/hr_org_chart.py +++ b/addons/hr_org_chart/controllers/hr_org_chart.py @@ -53,7 +53,10 @@ class HrOrgChartController(http.Controller): employee = self._check_employee(employee_id, **kw) if not employee: # to check - return {} + return { + 'managers': [], + 'children': [], + } # compute employee data for org chart ancestors, current = request.env['hr.employee.public'].sudo(), employee.sudo()