[FIX] [hr,sale]_timesheet: update timesheet's partner from Task
How to reproduce the problem:
- Install hr_timesheet and create a project.
- Create a task in the project, and assign a Partner as the Customer
- In the Timesheet tab of the Task, add a new entry. Save the Task.
- Edit the task again and change the Customer. Save again.
-> the partner on the Timesheet entry did not change.
With sale_timesheet, the Sales Order Item of the timesheet entry can
be updated from the Sales Order Item of the Task, but it isn't the case
with the partner, which is not logical.
Solution : Now, the partner_id is computed and will automatically be
updated from the Task's Customer/partner_id. If sale_timesheet is
installed, it will first filter out the invoiced timesheet entry:
we don't want to change an already invoiced entry.
opw-2616784
closes odoo/odoo#78577
Signed-off-by:
LTU-Odoo <IT-Ideas@users.noreply.github.com>
Showing
- addons/hr_timesheet/models/hr_timesheet.py 7 additions, 0 deletionsaddons/hr_timesheet/models/hr_timesheet.py
- addons/hr_timesheet/tests/test_timesheet.py 22 additions, 0 deletionsaddons/hr_timesheet/tests/test_timesheet.py
- addons/sale_timesheet/models/account.py 4 additions, 0 deletionsaddons/sale_timesheet/models/account.py
- addons/sale_timesheet/tests/test_sale_timesheet.py 72 additions, 0 deletionsaddons/sale_timesheet/tests/test_sale_timesheet.py
Please register or sign in to comment