We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 1ca7b28 + a810aef commit 9225cfdCopy full SHA for 9225cfd
mis_builder/models/mis_report_style.py
@@ -84,7 +84,6 @@ def check_positive_val(self):
84
}
85
86
# style name
87
- # TODO enforce uniqueness
88
name = fields.Char(string="Style name", required=True)
89
90
# color
@@ -133,6 +132,10 @@ def check_positive_val(self):
133
132
hide_always_inherit = fields.Boolean(default=True)
134
hide_always = fields.Boolean(default=False)
135
+ _sql_constraints = [
136
+ ("style_name_uniq", "unique(name)", "Style name should be unique")
137
+ ]
138
+
139
@api.model
140
def merge(self, styles):
141
"""Merge several styles, giving priority to the last.
0 commit comments