from netforce.model import Model, fields from netforce.access import get_active_company class CycleDialyLine(Model): _name="clinic.cycle.dialy.line" _string="Cycle Dialy Line" _fields={ "cycle_dialy_id": fields.Many2One("clinic.cycle.dialy","Cycle Dialy"), 'cycle_id': fields.Many2One("clinic.cycle", "Cycle"), 'personal_id': fields.Many2One("clinic.personal", "Personal"), 'paid_amount': fields.Float("Paid Amount"), 'company_id': fields.Many2One("company","Company"), "type": fields.Selection([("doctor","Doctor"),('nurse','Nurse'),("personal","Personal")],"Type",required=True), } _defaults={ 'company_id': lambda *a: get_active_company(), } CycleDialyLine.register()