From cae0d03ff78adea92e942739ed297bef25289e10 Mon Sep 17 00:00:00 2001 From: "Xavier BOL (xbo)" Date: Mon, 31 May 2021 08:52:44 +0000 Subject: [PATCH] [FIX] project: ensure only stage_id field is used in ir_model_fields Before this commit, the ir_model_fields used in the query could be another field than the one expected, that is the stage_id field. Indeed, since we don't check if the name column in the ir_model_fields is right the stage_id field then we could have the user_id or another many2one field. This commit adds a check to be sure we only use the stage_id. Related PR: #68343 closes odoo/odoo#71478 Signed-off-by: LTU-Odoo --- addons/project/report/project_task_burndown_chart_report.py | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/project/report/project_task_burndown_chart_report.py b/addons/project/report/project_task_burndown_chart_report.py index fc61faa419a..beef26eba97 100644 --- a/addons/project/report/project_task_burndown_chart_report.py +++ b/addons/project/report/project_task_burndown_chart_report.py @@ -68,6 +68,7 @@ class ReportProjectTaskBurndownChart(models.Model): INNER JOIN ir_model_fields imf ON mtv.field = imf.id AND imf.model = 'project.task' + AND imf.name = 'stage_id' INNER JOIN project_task_type current_stage ON mtv.old_value_integer = current_stage.id INNER JOIN project_task_type next_stage