Files
odoo_source/addons/hr_expense
yaih-odoo f16b194eaa [FIX] hr_expense: allow user access if manager
To reproduce:
 - Create an employee record for the connected admin user
 - Switch the user's company to another one
 - Upgrade to 17.0

A user who has the correct rights can change his company anytime to see employees from other companies
So it doesn't make sense to have access right error during an upgrade.
In this line: https://github.com/odoo/odoo/blob/140e58c5a68db674fc1d240147e4d669b29f2cad/addons/hr_expense/models/hr_expense_sheet.py#L385
The call to parent_id.user_id fail upgrades to 17.0 if the parent and the user have different companies.

Since Administrator-level users are not restricted, we put the check on that at the top to avoid errors during upgrades to 17.0.

closes odoo/odoo#150660

Note: in 17.1, it was made possible to have a manager from another company: https://github.com/odoo/odoo/pull/112768/commits/b841a24fc11cb83ca8e95fce7a83648d87cb90e3
Signed-off-by: John Laterre (jol) <jol@odoo.com>
2024-01-29 10:20:03 +00:00
..