-
- Downloads
[FIX] hr_leave: validate leave in multi-company environment
Validating an employee's leave with multiple companies selected doesn't
work when the employee isn't part of one of the selected companies
Steps to reproduce:
1. Install Time Off
2. Go to General Settings > Companies and create another company
3. Connect as Marc Demo, open Time Off and create a new time off request
4. Connect as Mitchell Admin and go to Time Off > Managers > Time Off
5. Approve and validate the time off request of Marc Demo
6. An access error is raised: `Access to unauthorized or invalid
companies.`
Solution:
Clear `allowed_company_ids` from the context when we create the
`calendar.event` to avoid raising the error
Problem:
The creation of the `calendar.event` didn't use the correct user's
`allowed_company_ids` in the context
opw-3052973
closes odoo/odoo#107085
Signed-off-by:
Kevin Baptiste <kba@odoo.com>