31 lines
716 B
Python
31 lines
716 B
Python
|
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()
|