Community mailing list archives

community@mail.odoo.com

sql constraints not working

by
shabeer
- 07/01/2016 06:12:19
hi community,
this sql constraints not working, please help me 

# Extending product.template
class apexion_product(models.Model):
"""docstring for apexion_product"""

_inherit = 'product.template'
md_approved = fields.Boolean(string="Is MD approved product")
brand_id = fields.Many2one('apexion.brand',string="Brand")

_sql_constraints = [
('name_unique', 'UNIQUE(name)', 'The name must be unique !'),
]