1.Assume you have inventory item definition on inventory.py
...............
_columns = {
'product_id' : fields.char('Product ID' , size=32 , required=True),
}
2. To make unique add the following line in the class
_sql_constraints=[( 'product_id_uniq', 'unique(product_id)' , 'Duplicate product id !')]
3.Enjoy
No comments:
Post a Comment