Community mailing list archives

Re: sql constraints not working

Vauxoo S.A. de C.V., Moisés Augusto López Calderón
- 07/01/2016 12:36:34

+1 with Julio's anwers

Review your log when run odoo... You should see a warning

El 01/07/2016 5:17 a.m., "shabeer m" <> escribió:
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 !'),

Post to: