from netforce.model import Model, fields from netforce.access import get_active_company class StaffCategory(Model): _name="clinic.staff.categ" _string="Staff Category" _key=["name"] _multi_company=True _fields={ "name": fields.Char("Name",required=True,search=True), "type": fields.Selection([("doctor","Doctor"),("nurse","Nurse"),('others','Others')],"Type"), 'parent_id': fields.Many2One("clinic.staff.categ","Parent"), 'company_id': fields.Many2One("company","Company"), 'note': fields.Text("Description"), } _defaults={ "company_id": lambda *a: get_active_company(), 'type': 'nurse', } StaffCategory.register()