From 9fdc83420751f1028af6cba51f4f0d84660489c3 Mon Sep 17 00:00:00 2001 From: Gurupreet Singh Date: Thu, 16 Feb 2023 05:18:00 +0000 Subject: [PATCH] [FIX] project: fix search view issue in website for milestone in tasks Before this commit if we go to website and choose tasks and if we search anything it shows no tasks available and if we select milestone it shows table. Steps: - Go to website and select tasks and search anything in search bar. - Showing no tasks available - choose milestone from drop-down and search anything it will show table labels. Fix: - Added condition for checking if milestone is passing empty record set and added another condition to handle it task-3183771 closes odoo/odoo#128204 X-original-commit: bcbfa314fb54039536b07446aa9c925378e68ab0 Signed-off-by: Xavier Bol (xbo) --- addons/project/controllers/portal.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/project/controllers/portal.py b/addons/project/controllers/portal.py index 798812cb5c2..97e4793dd80 100644 --- a/addons/project/controllers/portal.py +++ b/addons/project/controllers/portal.py @@ -417,7 +417,8 @@ class ProjectCustomerPortal(CustomerPortal): grouped_tasks = [Task_sudo.concat(*g) for k, g in groupbyelem(tasks_project_allow_milestone, itemgetter(group))] if not grouped_tasks: - grouped_tasks = [tasks_no_milestone] + if tasks_no_milestone: + grouped_tasks = [tasks_no_milestone] else: if grouped_tasks[len(grouped_tasks) - 1][0].milestone_id and tasks_no_milestone: grouped_tasks.append(tasks_no_milestone)