Community mailing list archives

community@mail.odoo.com

Re: sql constraints not working

by
shabeer
- 07/02/2016 01:02:33
Thanq...  Julio serna Hernandez , Moises Lopez 
its fine with new DB 


On Fri, Jul 1, 2016 at 10:06 PM, Moises Lopez <moylop260@vauxoo.com> wrote:

+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

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




--
with regards
Shabeer M
Contact : 94 00 7 44 77 6