Skip to content

Commit

Permalink
Merge pull request #2 from coopiteasy/9.0-unique-export-reference
Browse files Browse the repository at this point in the history
[IMP] res_partner.export reference is unique
  • Loading branch information
robinkeunen authored Jan 18, 2021
2 parents c0b1b9f + 0605051 commit 51501d8
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 51501d8

Please sign in to comment.