From 0605051a6203c1fbf73dd894be62a55628b11613 Mon Sep 17 00:00:00 2001 From: "robin.keunen" Date: Wed, 9 Sep 2020 16:11:52 +0200 Subject: [PATCH] [IMP] res_partner.export reference is unique --- csv_export_base/models/res_partner.py | 5 +++++ 1 file changed, 5 insertions(+) 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"