From 0c28a6387ff3351cb3bd41a82eb0602f9c2de898 Mon Sep 17 00:00:00 2001 From: jem-odoo Date: Wed, 12 Sep 2018 17:07:15 +0200 Subject: [PATCH] [FIX] sale_timesheet: too long sql name The generated SQL constraints name is too long, and so, when raising, it does not show the defined error message, since Postgresql truncated the name. thus Odoo can not match the error with the error message. Task #1883640 --- addons/sale_timesheet/models/project_sale_line_employee_map.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/sale_timesheet/models/project_sale_line_employee_map.py b/addons/sale_timesheet/models/project_sale_line_employee_map.py index 78174b654d7..04814503a01 100644 --- a/addons/sale_timesheet/models/project_sale_line_employee_map.py +++ b/addons/sale_timesheet/models/project_sale_line_employee_map.py @@ -19,5 +19,5 @@ class ProjectProductEmployeeMap(models.Model): price_unit = fields.Float(related='sale_line_id.price_unit', readonly=True) _sql_constraints = [ - ('uniq_map_sale_line_employee_per_project', 'UNIQUE(project_id,employee_id)', 'You can only map one employee with sale order item per project.'), + ('uniqueness_employee', 'UNIQUE(project_id,employee_id)', 'An employee cannot be selected more than once in the mapping. Please remove duplicate(s) and try again.'), ]