diff --git a/odoo/models.py b/odoo/models.py
index 875a233e22969036726a66a1dd8df7a5347b7521..757cc4f957f61e4f03ab031ce87d33aa04c13982 100644
--- a/odoo/models.py
+++ b/odoo/models.py
@@ -2884,10 +2884,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