from netforce.model import Model, fields class SettingAccountPatient(Model): _name="clinic.setting.account.patient" _string="Account Patient" _fields={ "setting_id": fields.Many2One("clinic.setting","Setting",required=True,on_delete="cascade"), "patient_id": fields.Many2One("clinic.patient","Patient",domain=[["state","=","admit"]]), 'partner_id': fields.Many2One("partner","Contact"), 'type_id': fields.Many2One("clinic.patient.type","Type"), 'hn': fields.Char("HN"), 'card_no': fields.Char("ID Card",size=13), } _order="type_id,patient_id" SettingAccountPatient.register()