from netforce.model import Model, fields class VascularAccess(Model): _name="clinic.vascular.access" _string="Vascular Access" _fields={ "name": fields.Char("Name",required=True,search=True), "code": fields.Char("Code",required=True,search=True), "description": fields.Char("Description",search=True), 'note': fields.Text("Note"), } _sql_constraints=("clinic_vascular_key_uniq","unique(code)","code should be unique"), VascularAccess.register()