26 lines
907 B
Python
26 lines
907 B
Python
from netforce.model import Model, fields
|
|
|
|
class ReportStaffLine(Model):
|
|
_name='clinic.report.staff.line'
|
|
_string="Report Staff Line"
|
|
|
|
def _get_all(self,ids,context={}):
|
|
res={}
|
|
for obj in self.browse(ids):
|
|
hdcase=obj.hd_case_id
|
|
res[obj.id]={
|
|
'date': hdcase.date,
|
|
'patient_id': hdcase.patient_id.id,
|
|
}
|
|
return res
|
|
|
|
_fields={
|
|
'report_staff_id': fields.Many2One("clinic.report.staff","Report Staff", required=True, on_delete="cascade"),
|
|
'hd_case_id': fields.Many2One("clinic.hd.case","HD Case"),
|
|
'date': fields.Date("Date",function="_get_all", function_multi=True),
|
|
'patient_id': fields.Many2One("clinic.patient","Patient",function="_get_all",function_multi=True,domain=[['state','=','admit']]),
|
|
'amount': fields.Float("Amount"),
|
|
}
|
|
|
|
ReportStaffLine.register()
|