Skip to content

Commit

Permalink
[ADD] product: constraint unique(barcode)
Browse files Browse the repository at this point in the history
  • Loading branch information
Whisno authored and sle-odoo committed Aug 27, 2015
1 parent c889b51 commit ede1071
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions addons/product/product.py
Original file line number Diff line number Diff line change
Expand Up @@ -976,6 +976,10 @@ def _get_price_extra(self, cr, uid, ids, name, args, context=None):
'color': 0,
}

_sql_constraints = [
('barcode_uniq', 'unique(barcode)', _("A barcode can only be assigned to one product !")),
]

def unlink(self, cr, uid, ids, context=None):
unlink_ids = []
unlink_product_tmpl_ids = []
Expand Down

0 comments on commit ede1071

Please sign in to comment.