basic report template

conv_bal
chayut.s 2014-10-09 17:53:01 +07:00
parent b9264098d3
commit 5aee7a60b5
6 changed files with 49 additions and 2 deletions

View File

@ -0,0 +1,8 @@
<action>
<field name="string">Report HD Case</field>
<field name="view_cls">report</field>
<field name="model">clinic.hd.report</field>
<field name="report_template">report_hd_report</field>
<field name="report_template_xls">hd_report</field>
<field name="menu">clinic_menu</field>
</action>

View File

@ -0,0 +1,4 @@
<form model="clinic.hd.report">
<field name="cycle"/>
<field name="date"/>
</form>

View File

@ -23,12 +23,14 @@
<!--<item string="Visit" action="clinic_visit"/>--> <!--<item string="Visit" action="clinic_visit"/>-->
<!--</item>--> <!--</item>-->
<item string="Reports"> <item string="Reports">
<item string="Clinic Round(Testing)" action="report_clinic_round"/> <item string="Treatment Report" action="clinic_hd_report"/>
<item string="Clinic Round(Testing)" action="clinic_round_report"/>
</item> </item>
<item string="Imports"> <item string="Imports">
<item string="Import Payments" action="clinic_import_payment"/> <item string="Import Payments" action="clinic_import_payment"/>
</item> </item>
<item string="Settings"> <item string="Settings">
<item string="Round" action="clinic_round"/>
<item string="Departments" action="clinic_department"/> <item string="Departments" action="clinic_department"/>
<item string="Clinic Settings" action="clinic_setting"/> <item string="Clinic Settings" action="clinic_setting"/>
</item> </item>

View File

@ -17,6 +17,9 @@ from . import doctor
from . import nurse from . import nurse
from . import visit from . import visit
from . import visit_plan from . import visit_plan
from . import clinic_round
from . import clinic_round_report
from . import report_hd
from . import hd_case from . import hd_case
from . import hd_case_line from . import hd_case_line
from . import hd_case_discont from . import hd_case_discont
@ -28,7 +31,6 @@ from . import graduation
from . import nation from . import nation
from . import race from . import race
from . import cause_chronic from . import cause_chronic
from . import clinic_round
from . import dialyzer_line from . import dialyzer_line
from . import import_payment from . import import_payment
from . import file_sheet from . import file_sheet

View File

@ -0,0 +1,30 @@
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()

View File

@ -0,0 +1 @@
<h1 style="color: red">Cycle {{cycle}}</h1>