From 58195290ccdd75809757b67de66df4e2c9d62369 Mon Sep 17 00:00:00 2001 From: "Xavier BOL (xbo)" Date: Tue, 7 Sep 2021 14:58:02 +0000 Subject: [PATCH] [FIX] project: count all active tasks instead of open tasks in project Before this commit, the task_count field displayed in the 'Tasks' stat button shows the number of open tasks, that is all tasks with either no stage linked or stage not folded or not closed. The problem is when the user clicks on this stat button (displayed in project form view or in project update), he sees all active tasks in the project. This commit changes the count to display the number of active tasks instead of the number of open tasks in the project. task-2633229 closes #76167 X-original-commit: f6ace36d7f61c005f324559d02436f7ff69eb40a Part-of: odoo/odoo#76263 --- addons/project/models/project.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/addons/project/models/project.py b/addons/project/models/project.py index 76c8fd22e56..43f320c10e5 100644 --- a/addons/project/models/project.py +++ b/addons/project/models/project.py @@ -161,10 +161,8 @@ class Project(models.Model): 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)], + ('stage_id', '=', False)], ['project_id', 'display_project_id:count'], ['project_id']) result_wo_subtask = defaultdict(int) result_with_subtasks = defaultdict(int)