2015-01-30 11:15:13 +00:00
|
|
|
from netforce.model import Model, fields
|
|
|
|
|
|
|
|
class ReportStaffLine(Model):
|
|
|
|
_name='clinic.report.staff.line'
|
|
|
|
_string="Report Staff Line"
|
2015-02-02 10:35:47 +00:00
|
|
|
|
|
|
|
def _get_all(self,ids,context={}):
|
|
|
|
res={}
|
|
|
|
for obj in self.browse(ids):
|
|
|
|
res[obj.id]={
|
|
|
|
'date': obj.hd_case_id.date,
|
|
|
|
'patient_id': obj.hd_case_id.patient_id.id,
|
|
|
|
}
|
|
|
|
return res
|
|
|
|
|
2015-01-30 11:15:13 +00:00
|
|
|
_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"),
|
2015-02-02 10:35:47 +00:00
|
|
|
'date': fields.Date("Date",function="_get_all", function_multi=True),
|
2015-03-02 04:03:07 +00:00
|
|
|
'patient_id': fields.Many2One("clinic.patient","Patient",function="_get_all",function_multi=True,domain=[['state','=','admit']]),
|
2015-02-02 10:35:47 +00:00
|
|
|
'amount': fields.Float("Amount"),
|
2015-01-30 11:15:13 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
ReportStaffLine.register()
|