File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1313class 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 ,
You can’t perform that action at this time.
0 commit comments