From 8d721f67283c7545ce04694ee840cc991d4ef795 Mon Sep 17 00:00:00 2001 From: Jinal Patel Date: Tue, 19 May 2020 05:33:31 +0000 Subject: [PATCH] [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) --- odoo/addons/base/models/ir_model.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/odoo/addons/base/models/ir_model.py b/odoo/addons/base/models/ir_model.py index c94e9cd9fe3..945268bb336 100644 --- a/odoo/addons/base/models/ir_model.py +++ b/odoo/addons/base/models/ir_model.py @@ -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):