[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 <IT-Ideas@users.noreply.github.com>
This commit is contained in:
Xavier BOL (xbo)
2021-05-31 08:59:08 +00:00
parent d23d875464
commit cae0d03ff7
@@ -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