Skip to content

Commit

Permalink
[IMP] res_partner.export reference is unique
Browse files Browse the repository at this point in the history
  • Loading branch information
robinkeunen committed Sep 21, 2020
1 parent 5e7d353 commit 0605051
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions csv_export_base/models/res_partner.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 0605051

Please sign in to comment.