diff --git a/mis_builder/models/mis_report_style.py b/mis_builder/models/mis_report_style.py index 4563844ff..cd4327fd7 100644 --- a/mis_builder/models/mis_report_style.py +++ b/mis_builder/models/mis_report_style.py @@ -84,7 +84,6 @@ def check_positive_val(self): } # style name - # TODO enforce uniqueness name = fields.Char(string="Style name", required=True) # color @@ -133,6 +132,10 @@ def check_positive_val(self): hide_always_inherit = fields.Boolean(default=True) hide_always = fields.Boolean(default=False) + _sql_constraints = [ + ("style_name_event_uniq", "unique(name)", "Style name should be unique") + ] + @api.model def merge(self, styles): """Merge several styles, giving priority to the last.