diff --git a/partner_changeset/models/changeset_field_rule.py b/partner_changeset/models/changeset_field_rule.py index 31eda92e8..2da4c376c 100644 --- a/partner_changeset/models/changeset_field_rule.py +++ b/partner_changeset/models/changeset_field_rule.py @@ -43,6 +43,12 @@ class ChangesetFieldRule(models.Model): "Never: change never applied.", ) + _sql_constraints = [ + ('model_field_uniq', + 'unique (model_id, field_id)', + 'A rule already exists for this field.') + ] + @api.model def _default_model_id(self): return self.env.ref('base.model_res_partner').id