Saturday, January 7, 2023
1 change · master
Miscellaneous changes
Steps to reproduce: - Create 2 projects: `Project1` and `Project2` - Enable sub-tasks - In Project1 create a task, name it `1`. - In task 1 add a subtask, name it `1:1`. - In task 1:1 add another subtask, name it `1:1:1`. - Go to Timesheet app > add lines for each task. - The lines display name are `Project1 / 1`, ... - Go back to task 1, edit the task project to Project2 and save. - The subtasks will have their project_id also set to Project2. - Go to Timesheet app. Issue: Tasks
Original PR description
Steps to reproduce: - Create 2 projects: `Project1` and `Project2` - Enable sub-tasks - In Project1 create a task, name it `1`. - In task 1 add a subtask, name it `1:1`. - In task 1:1 add another…
Steps to reproduce: - Create 2 projects: `Project1` and `Project2` - Enable sub-tasks - In Project1 create a task, name it `1`. - In task 1 add a subtask, name it `1:1`. - In task 1:1 add another subtask, name it `1:1:1`. - Go to Timesheet app > add lines for each task. - The lines display name are `Project1 / 1`, ... - Go back to task 1, edit the task project to Project2 and save. - The subtasks will have their project_id also set to Project2. - Go to Timesheet app. Issue: Tasks `1` and `1:1` will have their display names updated to `Project2 / 1` and `Project2 / 1:1`. However, task `1:1:1` is displayed as `Project1 / 1:1:1`, meaning that the `project_id` field was never updated. This happens because of the way changed fields propagate to immediate children, but not to grandchildren, which is intended behaviour. Solution: `_compute_project_id` is also called onchange, meaning that we can use it to update account lines with an outdated project value with the new value. opw-3018301 Forward-Port-Of: odoo/odoo#109263 Forward-Port-Of: odoo/odoo#106164