Tuesday, August 20, 2019

constrant unique to field in odoo

ODOO

sql constraint work on the database and called when we want to create new record in database table 
we can make field unique as bellow 
 
_sql_constraints = [
        ('unique_code', 'unique(code)', 'Employee code must be unique !')
    ]

here we make constraint unique for employee code

No comments:

Post a Comment

Odoo Invoice Qr code issues

There are two main issues must of us facing with the QR code in Odoo invoice & these issues are 1/ QR code displayed as broken image w...