Skip to content

Commit 3ec8ba1

Browse files
committed
[IMP]project_ux:always display_in_project = True
1 parent 4d86997 commit 3ec8ba1

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

project_ux/models/project_task.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,31 @@
1313
class Task(models.Model):
1414
_inherit = "project.task"
1515

16+
display_in_project = fields.Boolean(default=True)
17+
18+
@api.depends("project_id")
19+
def _compute_display_in_project(self):
20+
"""We always want subtasks to be displayed in the project pipeline.
21+
By default Odoo hides subtasks that share the same project as their
22+
parent, making them invisible in kanban/list views. We override to
23+
always set True so every task is visible. Users can still manually
24+
hide individual tasks using the 'Hide in pipeline' button.
25+
"""
26+
for task in self:
27+
task.display_in_project = True
28+
29+
@api.model_create_multi
30+
def create(self, vals_list):
31+
"""Force display_in_project=True on creation.
32+
Odoo's views pass 'default_display_in_project': False in the context
33+
when creating subtasks, which overrides both the field default and the
34+
compute. We force it here so subtasks are always visible in the
35+
pipeline.
36+
"""
37+
for vals in vals_list:
38+
vals["display_in_project"] = True
39+
return super().create(vals_list)
40+
1641
dont_send_stage_email = fields.Boolean(
1742
string="Don't Send Stage Email",
1843
default=False,

0 commit comments

Comments
 (0)