diff options
| author | Shreya Modi <smo@odoo.com> | 2019-06-14 06:46:49 +0000 |
|---|---|---|
| committer | Yannick Tivisse <yti@odoo.com> | 2019-06-25 08:04:08 +0000 |
| commit | e092060dfeea1eeba852e06106fe66f147cacd00 (patch) | |
| tree | a49fb425b1c496bce76b59702eef70486eb2e6d4 | |
| parent | ccf4fc244a62067a49d3dc411fa689c4bc7ceeed (diff) | |
[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
| -rw-r--r-- | addons/hr_org_chart/controllers/hr_org_chart.py | 5 |
1 files changed, 4 insertions, 1 deletions
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() |
