clinic/netforce_clinic/models/report_hd.py

31 lines
716 B
Python
Raw Normal View History

2014-10-09 10:53:01 +00:00
import time
from netforce.model import Model, fields
class HDReport(Model):
_name="clinic.hd.report"
_string="HD Report"
_transient=True
_fields={
"date": fields.Date("Date"),
"cycle": fields.Selection([("1","One"),("2","Two"),("3","Three"),("4","Four")],"Cycle"),
}
_defaults={
'date': lambda *a: time.strftime("%Y-%m-%d"),
}
def get_report_data(self,ids,context={}):
print(">>>>>>>>>>>>>>>>>>>>>>>>>>>>.")
if not ids:
return {}
obj=self.browse(ids)[0]
#get_model('clinic.patient').search
data={
'cycle': obj.cycle or "Empty Cyle"
}
return data
HDReport.register()