[IMP] base: change unique model name sql constraint message

-Purpose of this task is to make the unique model name constraint
 clearer by specifing name of the model needs to be unique.

-In this commit, change the constraint message from
 'Each model must be unique!' to
 'Each model must have a unique name.' to let the user know name
 of the model causes the issue.

task-2254964
Closes-#51513

closes odoo/odoo#51513

Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
This commit is contained in:
Jinal Patel
2020-05-19 09:08:36 +00:00
parent 585a28b89a
commit 8d721f6728
+1 -1
View File
@@ -234,7 +234,7 @@ class IrModel(models.Model):
raise ValidationError(_("Unable to order by %s: fields used for ordering must be present on the model and stored.", field))
_sql_constraints = [
('obj_name_uniq', 'unique (model)', 'Each model must be unique!'),
('obj_name_uniq', 'unique (model)', 'Each model must have a unique name.'),
]
def _get(self, name):