diff options
| author | Nisha patel <nit@odoo.com> | 2020-07-24 11:17:25 +0000 |
|---|---|---|
| committer | Yannick Tivisse <yti@odoo.com> | 2020-08-03 15:49:52 +0000 |
| commit | e0a7add01fe3d634e6024b75a0f29240a8581d4d (patch) | |
| tree | e05a3c3e7fa668ca77a6e93324b7762a27802a6d /addons/project | |
| parent | ba03b6c6977b0fa21c954844f021ed2cc619171f (diff) | |
[FIX] project: Fix sub-tasks stat button count
Currently, In the project module, the archived/deleted sub-task is
not deducted from the count of the 'sub-tasks' stat button.
Steps to reproduce:
- Go to Project > Configuration > Settings > Enable 'sub-tasks'
- Go to a Project with sub-tasks enabled, open a task and create a sub-task
- Archive/Delete this sub-task
So in this commit, we applied filter on sub-task which show only active
sub-task on the stat button.
closes odoo/odoo#55347
Taskid: 2304887
Closes: #54904
X-original-commit: 81db237e3324922ff16f2b290922f21d98046738
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Diffstat (limited to 'addons/project')
| -rw-r--r-- | addons/project/models/project.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/project/models/project.py b/addons/project/models/project.py index a8725944b39..00ccd6dc760 100644 --- a/addons/project/models/project.py +++ b/addons/project/models/project.py @@ -1067,7 +1067,7 @@ class Task(models.Model): # If depth == 3, return children to third generation # If depth <= 0, return all children without depth limit def _get_all_subtasks(self, depth=0): - children = self.mapped('child_ids') + children = self.mapped('child_ids').filtered(lambda children: children.active) if not children: return self.env['project.task'] if depth == 1: |
