from netforce.model import Model, fields from netforce.access import get_active_company class Department(Model): _name="clinic.department" _string="Department" _fields={ "name": fields.Char("Name",required=True,search=True), "code": fields.Char("Code",search=True), "parent_id": fields.Many2One("clinic.department", "Parent"), } _defaults={ 'company_id': lambda *a: get_active_company(), } Department.register()