-
- Downloads
[FIX] hr_org_chart: fix employee deletion
How to reproduce:
1: create two employees (A B) and two departments (C D)
2: Assign A as manager of C and B as manager of D
3: Assign C as A's department and A as A's manager
4: Change A's department to D -> A is deleted
This is due to `parent_id` being both a computed field and the source
field for a One2many. By changing the `department_id` the `parent_id`
also changed which results in it being report in the `onchange` method.
For some reason however the command sent by the orm is not `UNLINK` but
`DELETE` which results in the `active_id` being deleted.
TaskId-2711428
closes odoo/odoo#81122
Signed-off-by:
Yannick Tivisse (yti) <yti@odoo.com>
Showing
- addons/hr_org_chart/tests/__init__.py 4 additions, 0 deletionsaddons/hr_org_chart/tests/__init__.py
- addons/hr_org_chart/tests/test_employee_deletion.py 39 additions, 0 deletionsaddons/hr_org_chart/tests/test_employee_deletion.py
- addons/hr_org_chart/views/hr_views.xml 2 additions, 2 deletionsaddons/hr_org_chart/views/hr_views.xml
addons/hr_org_chart/tests/__init__.py
0 → 100644
Please register or sign in to comment