Hi
how to change field default_code in product.product to unique
my code
from __future__ import division
from openerp.osv import fields, osv
class product_product(osv.osv):
_inherit = 'product.product'
_columns = {
'default_code' : fields.char('Internal Reference', size=64, select=True),
}
_sql_constraints = [('ref_unique','unique(default_code)', 'reference must be unique!')]
product_product()
thanks
is it working fine for you? or check this link: https://github.com/OCA/product-attribute/blob/7.0/product_sequence/product_product.py