from netforce.model import Model, fields class Nation(Model): _name="clinic.nation" _string="Nationality" _key=['code'] _fields={ "name": fields.Char("Name",required=True,search=True), "code": fields.Char("Code",search=True), 'default': fields.Boolean("Default"), } def write(self,ids,vals,**kw): default=vals.get('default') if default: for obj in self.search_browse([]): if obj.id not in ids: obj.write({ 'default': False, }) super().write(ids,vals,**kw) Nation.register()