diff --git a/csv_export_base/models/res_partner.py b/csv_export_base/models/res_partner.py index c9800af..da92451 100644 --- a/csv_export_base/models/res_partner.py +++ b/csv_export_base/models/res_partner.py @@ -9,6 +9,11 @@ class ResPartner(models.Model): _inherit = "res.partner" + _sql_constraints = [ + ('partner_export_reference_unique', 'UNIQUE (export_reference)', + 'The export reference must be unique!'), + ] + def _default_export_reference(self): return self.env["ir.sequence"].next_by_code( "res.partner.export.reference"