[FIX] project: fix count for task with NULL project_id
This commit fixes a regression introduced in #62577 . Tasks are only taken into account iff their project_id is in self.ids. closes odoo/odoo#69303 X-original-commit: 5be4970ddec2d9052d3b044e6e156aef94442c9a Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
This commit is contained in:
committed by
Thibault Libioulle
parent
88957afca0
commit
b2a3471293
@@ -116,8 +116,14 @@ class Project(models.Model):
|
||||
])
|
||||
|
||||
def _compute_task_count(self):
|
||||
task_data = self.env['project.task'].read_group(['|', '&', ('stage_id.is_closed', '=', False), ('stage_id.fold', '=', False), ('stage_id', '=', False)],
|
||||
['project_id', 'display_project_id:count'], ['project_id'])
|
||||
task_data = self.env['project.task'].read_group(
|
||||
[('project_id', 'in', self.ids),
|
||||
'|',
|
||||
'&',
|
||||
('stage_id.is_closed', '=', False),
|
||||
('stage_id.fold', '=', False),
|
||||
('stage_id', '=', False)],
|
||||
['project_id', 'display_project_id:count'], ['project_id'])
|
||||
result_wo_subtask = defaultdict(int)
|
||||
result_with_subtasks = defaultdict(int)
|
||||
for data in task_data:
|
||||
|
||||
Reference in New Issue
Block a user