Files
odoo_source/addons
Paul Stroobant f032256c4f [FIX] hr_contract: prevent copy of contract_id on employee duplicate
Steps to reproduce issue:

1. Create two companies, **A** and **B**.
2. Create employee *X* in **A**.
3. Create a contract, assign it to *X* and change its state to Running.
4. Duplicate *X* to create employee *Y*
5. Change *Y*'s company to **B** (bypass warnings and errors).
6. Try to access Payroll Dashboard.
7. A Multi-Company access errors is raised

Explanation:

When duplicating *X*, the value from `contract_id` is copied to *Y*.
After *Y*'s company is changed to **B**, Payroll Dashboard tries to retrieve data from its `contract_id` and, the contract still being related to **A**, a Multi-Company access error occurs.

Suggested fix:

Preventing the value being copied solves the problem. It also lines up with the `contract_ids` not being copied.
The root issue existing in *v15.0*, the fix will be implemented in that version too.

opw-3623483

closes odoo/odoo#146890

X-original-commit: 703863d86c603a4cbbd6115713cd5d49e1887a22
Signed-off-by: Sofie Gvaladze (sgv) <sgv@odoo.com>
Signed-off-by: Stroobant Paul (stpa) <stpa@odoo.com>
2023-12-20 12:36:44 +00:00
..
2023-11-08 13:34:06 +00:00
2023-11-13 07:26:00 +00:00
2023-12-20 08:35:43 +00:00