To make a unique field and do not allow duplicates records in openerp, below is the solution
In .py file use this code:-
class course(osv.osv):
_name="course"
_columns={
"name":fields.char("Name"),
}
_sql_constraints=[('course_unique', 'unique(name)', 'Name should be unique')
]
course()
0 Comment(s)