From 506e7792613357f6dcd62ed714d42d64ff176991 Mon Sep 17 00:00:00 2001 From: Prakash Prajapati Date: Wed, 19 Jul 2023 13:48:09 +0000 Subject: [PATCH] [FIX] project: hide empty stages when user perform subtask action Step: - Install project app - Activated Task Dependencies - Create project and task - Add sub-task - Click sub-task action issue: In the commit below we have passed the default_project reference so we get the current project stage. Fix: we pass 'subtask_action' context to subtask action and we checked that context in _read_group_stage_ids method if subtask_action context is found then we will not fetch project's stages. Side effect of this commit-https://github.com/odoo/odoo/commit/23cf9318084c8a00f37ffcefefa3e056583d2d77 task-3390279 closes odoo/odoo#138024 X-original-commit: 82c29c03cbaa351600b782082554378b4a320b73 Signed-off-by: Xavier Bol (xbo) --- addons/project/models/project_task.py | 2 +- addons/project/views/project_task_views.xml | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/addons/project/models/project_task.py b/addons/project/models/project_task.py index f9b654d9ff7..d3cbc192103 100644 --- a/addons/project/models/project_task.py +++ b/addons/project/models/project_task.py @@ -108,7 +108,7 @@ class Task(models.Model): @api.model def _read_group_stage_ids(self, stages, domain, order): search_domain = [('id', 'in', stages.ids)] - if 'default_project_id' in self.env.context: + if 'default_project_id' in self.env.context and not self._context.get('subtask_action'): search_domain = ['|', ('project_ids', '=', self.env.context['default_project_id'])] + search_domain stage_ids = stages._search(search_domain, order=order, access_rights_uid=SUPERUSER_ID) diff --git a/addons/project/views/project_task_views.xml b/addons/project/views/project_task_views.xml index 7694f489fd5..168c2ebb2dd 100644 --- a/addons/project/views/project_task_views.xml +++ b/addons/project/views/project_task_views.xml @@ -292,7 +292,8 @@