diff --git a/odoo/models.py b/odoo/models.py index 55da6e0765591d969485b8920ed326d2bb9d209b..efd795b7a529f8e0a51174932092643f3782651c 100644 --- a/odoo/models.py +++ b/odoo/models.py @@ -2620,10 +2620,9 @@ class BaseModel(metaclass=MetaModel): for (key, definition, message) in self._sql_constraints: conname = '%s_%s' % (self._table, key) - if len(conname) > 63: - _logger.info("Constraint name %r has more than 63 characters", conname) - current_definition = tools.constraint_definition(cr, self._table, conname) + if len(conname) > 63 and not current_definition: + _logger.info("Constraint name %r has more than 63 characters", conname) if current_definition == definition: continue