Community mailing list archives

community@mail.odoo.com

Re: sql constraints not working

by
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" <msg2shabeer@gmail.com> 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 !'),
]

_______________________________________________
Mailing-List: https://www.odoo.com/groups/community-59
Post to: mailto:community@mail.odoo.com
Unsubscribe: https://www.odoo.com/groups?unsubscribe