from netforce.model import Model, fields, get_model from netforce.access import get_active_company class CycleItemDoctor(Model): _name="clinic.cycle.item.doctor" _string="Cycle Item Doctor" _fields={ 'cycle_item_id': fields.Many2One("clinic.cycle.item", "Cycle Item"), 'categ_id': fields.Many2One("clinic.personal.categ", "Category",), 'doctor_id': fields.Many2One("clinic.personal",'Doctor',domain=[['type','=','doctor']]), } _defaults={ "company_id": lambda *a: get_active_company(), } CycleItemDoctor.register()