diff options
| author | Toufik Ben Jaa <tbe@odoo.com> | 2019-09-23 09:36:11 +0000 |
|---|---|---|
| committer | Toufik Ben Jaa <tbe@odoo.com> | 2019-09-23 10:12:31 +0000 |
| commit | 3a81d43aff409b43138bc37f678d34067939c1ce (patch) | |
| tree | 58147ad4358c42bf1994bbc6f317b26cbfee50a9 /addons/hr_org_chart/controllers | |
| parent | d3ddcc613f873b2f7073c45fea16c1f57abe278a (diff) | |
[FIX] hr{_org_chart}: multi-company access issues on employees
- Avoid to crash when trying to render an employee's org chart
when in a different company than yours.
- Retrieve the context from the current environment instead of
the `_check_employee` function parameters.
closes odoo/odoo#37251
Signed-off-by: Romain Libert (rli) <rli@odoo.com>
Diffstat (limited to 'addons/hr_org_chart/controllers')
| -rw-r--r-- | addons/hr_org_chart/controllers/hr_org_chart.py | 4 |
1 files changed, 2 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 fb389f6bb51..1399919b2de 100644 --- a/addons/hr_org_chart/controllers/hr_org_chart.py +++ b/addons/hr_org_chart/controllers/hr_org_chart.py @@ -14,8 +14,8 @@ class HrOrgChartController(http.Controller): return None employee_id = int(employee_id) - if ('context' in kw and 'allowed_company_ids' in kw['context']): - cids = kw['context']['allowed_company_ids'] + if 'allowed_company_ids' in request.env.context: + cids = request.env.context['allowed_company_ids'] else: cids = [request.env.company.id] |
