2014-11-05 06:45:28 +00:00
|
|
|
import time
|
|
|
|
|
|
|
|
from netforce.model import Model,fields,get_model
|
2014-11-05 07:03:12 +00:00
|
|
|
from netforce.access import get_active_company
|
2014-11-05 06:45:28 +00:00
|
|
|
|
|
|
|
class ReportMedicalSummary(Model):
|
|
|
|
_name="clinic.report.medical.summary"
|
|
|
|
_string="Report Medical Summary"
|
|
|
|
_transient=True
|
|
|
|
|
|
|
|
_fields={
|
|
|
|
"date": fields.Date("Month", required=True),
|
|
|
|
}
|
|
|
|
|
|
|
|
_defaults={
|
|
|
|
'date': lambda *a: time.strftime("%Y-%m-%d"),
|
|
|
|
}
|
|
|
|
|
|
|
|
def get_report_data(self,ids,context={}):
|
2014-11-05 07:28:20 +00:00
|
|
|
obj=self.browse(ids)[0]
|
|
|
|
|
2014-11-05 07:03:12 +00:00
|
|
|
company_id=get_active_company()
|
|
|
|
company=get_model('company').browse(company_id)
|
|
|
|
data={
|
|
|
|
'company_name': company.name or "",
|
|
|
|
'parent_company_name': company.parent_id.name or "",
|
|
|
|
}
|
2014-11-05 06:45:28 +00:00
|
|
|
return data
|
|
|
|
|
|
|
|
ReportMedicalSummary.register()
|