From c0f6ecd5d2eff49b95d6ca6a52a3116a924e2b64 Mon Sep 17 00:00:00 2001 From: suresh badikala Date: Wed, 1 Nov 2023 18:25:21 +0530 Subject: [PATCH] [FIX] project: fix the traceback when group by project in the planning Steps: - Open Field service - Select planning then by user - Group by project - The trace back is coming Issue: - when we trying to group by projects the trace back is raised. Cause: - In '_search_on_comodel' method filtered_domain does't set perfectly, The filtered_domain it is not set for the additional_domain , when we given on additional_domain, on that time filter_domain does not consider the additional_domain, because of that traceback will be coming. Fix: - By adding an 'if' condition for cases when you provide an additional domain, it will work fine. task-3522178 closes odoo/odoo#140661 Related: odoo/enterprise#48652 Signed-off-by: Xavier Bol (xbo) --- addons/project/models/project_task.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/addons/project/models/project_task.py b/addons/project/models/project_task.py index 8465f69eac3..990f04faed7 100644 --- a/addons/project/models/project_task.py +++ b/addons/project/models/project_task.py @@ -1161,11 +1161,9 @@ class Task(models.Model): f"{field}.id": "id", f"{field}.name": "name", }) - if not filtered_domain: - return False if additional_domain: - filtered_domain = expression.AND([filtered_domain, additional_domain]) - return self.env[comodel].search(_change_operator(filtered_domain), order=order) + filtered_domain = expression.AND([_change_operator(filtered_domain), additional_domain]) + return self.env[comodel].search(filtered_domain, order=order) if filtered_domain else False # --------------------------------------------------- # Subtasks