Following https://github.com/odoo/enterprise/pull/31202, it happens that the query for the contract history returns several times the same id if the employee has several contracts. This commit fixes it by adding a DISTINCT to the SQL query so that ID returned are unique. task-2974531 closes odoo/odoo#100027 Related: odoo/enterprise#31202 Signed-off-by: Kevin Baptiste <kba@odoo.com>