Skip to content

Commit

Permalink
Merge PR #656 into 17.0
Browse files Browse the repository at this point in the history
Signed-off-by sbidoul
  • Loading branch information
OCA-git-bot committed Dec 16, 2024
2 parents 21bccb7 + f12a94f commit c6534c4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion mis_builder/models/mis_report_style.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ def check_positive_val(self):
}

# style name
# TODO enforce uniqueness
name = fields.Char(string="Style name", required=True)

# color
Expand Down Expand Up @@ -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_uniq", "unique(name)", "Style name should be unique")
]

@api.model
def merge(self, styles):
"""Merge several styles, giving priority to the last.
Expand Down

0 comments on commit c6534c4

Please sign in to comment.