[FIX] project: prevent auto-assignment of projects to sub-tasks

**Issue Description**:
From versions 16.3 to the master branch, a sub-task should never be assigned to a project automatically. However, when accessing `Sub-tasks` through the smart button and creating a new one, the context pass variable such as `'default_project_id': 4`. This leads to the sub-task being created with an assigned project immediately.

**Steps to Reproduce**:
1. Open `Project` app.
2. Enter any project, then navigate to any task.
3. Within the task, go to `sub-task` tab.
4. At the top center of the page, click on 'Sub-task' smart button.
5. Then, create a new sub-task using the 'New' button.
6. You will observe that the sub-task is immediately assigned to a project, which should not happen.

**Proposed Solution**:
By removing the passing of the default_project_id variable from the context when open a sub-task action, we ensure that sub-tasks are not automatically assigned to a project, as intended.

opw-3708537

closes odoo/odoo#154101

X-original-commit: c45ac4c9584f961ea0cdedffdf2b4bbe9058e8d9
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
Signed-off-by: Ilya Rudy (ilru) <ilru@odoo.com>
This commit is contained in:
ilru-odoo
2024-02-14 22:00:02 +00:00
parent 57d8f588f6
commit 882c852603
+1 -1
View File
@@ -293,7 +293,7 @@
</button>
<button name="%(project_task_action_sub_task)d" type="action" class="oe_stat_button" icon="fa-tasks"
invisible="not id or subtask_count == 0"
context="{'default_user_ids': user_ids, 'default_project_id': project_id, 'default_milestone_id': milestone_id, 'subtask_action': True}">
context="{'default_user_ids': user_ids, 'default_milestone_id': milestone_id, 'subtask_action': True}">
<div class="o_field_widget o_stat_info">
<div class="d-flex align-items-baseline gap-1">
<span class="o_stat_value order-1">