test report

conv_bal
chayut.s 2014-10-08 11:36:22 +07:00
parent 03780c2668
commit f451a92807
14 changed files with 117 additions and 46 deletions

View File

@ -0,0 +1,6 @@
<action>
<field name="type">report_odt</field>
<field name="model">clinic.visit</field>
<field name="method">get_visit_demo</field>
<field name="template">visit_demo</field>
</action>

View File

@ -0,0 +1,6 @@
<action>
<field name="string">Nationalities</field>
<field name="view_cls">multi_view</field>
<field name="model">clinic.round</field>
<field name="menu">clinic_menu</field>
</action>

View File

@ -0,0 +1,6 @@
<action>
<field name="type">report_odt</field>
<field name="model">clinic.round</field>
<field name="method">get_data</field>
<field name="template">round</field>
</action>

View File

@ -0,0 +1,5 @@
<action>
<field name="type">report_odt2</field>
<field name="model">clinic.visit</field>
<field name="template">visit_form</field>
</action>

View File

@ -5,43 +5,31 @@
<item string="Journal Report" method="journal_report"/> <item string="Journal Report" method="journal_report"/>
</button> </button>
</head> </head>
<group span="6" columns="1"> <separator string="Healthy Information"/>
<field name="number"/> <field name="wh_start"/>
<field name="date_start"/> <field name="wh_stop"/>
<field name="total_time"/> <field name="bp_start"/>
<field name="department_id"/> <field name="bp_stop"/>
<field name="visit_id"/> <field name="per_bp_start"/>
</group> <field name="per_bp_stop"/>
<group span="6" columns="1"> <field name="epo_tn"/>
<field name="patient_id" onchange="onchange_patient"/> <field name="epo_unit"/>
<field name="date_stop"/> <field name="hct" onchange="onchange_htc"/>
<field name="doctor_id"/> <separator string="Dialyzer"/>
<field name="nurse_id"/> <field name="dialyzers" nolabel="1">
</group> <list>
<tabs> <field name="dialyzer_id"/>
<tab string="Dialyzer"> <field name="use_time"/>
<field name="dialyzers" nolabel="1"> <field name="max_use_time"/>
<list> <field name="member_type"/>
<field name="dialyzer_id"/> <field name="dialyzer_type"/>
<field name="use_time"/> <field name="bid_flow_rate"/>
<field name="max_use_time"/> <field name="ultrafittration"/>
<field name="member_type"/> </list>
<field name="dialyzer_type"/> </field>
<field name="bid_flow_rate"/> <!--<separator string="Choose Payment"/>
<field name="ultrafittration"/> <field name="check_goverment_pay"/>
</list> <field name="check_personal_pay"/>-->
</field>
</tab>
<tab string="Healthy Information">
<field name="wh_start"/>
<field name="wh_stop"/>
<field name="bp_start"/>
<field name="per_bp_start"/>
<field name="bp_stop"/>
<field name="per_bp_stop"/>
<field name="hct"/>
</tab>
</tabs>
<separator string="Others Payment"/> <separator string="Others Payment"/>
<field name="lines" count="4" nolabel="1"> <field name="lines" count="4" nolabel="1">
<list> <list>
@ -53,13 +41,22 @@
<field name="amount"/> <field name="amount"/>
</list> </list>
</field> </field>
<group span="4" columns="1"> <separator string="Other Goverment"/>
<field name="fee"/> <field name="lines" count="4" nolabel="1">
<!--<field name="fee_type" onchange="onchange_fee_type"/>--> <list>
<field name="fee_partner_id" domain="[['type','=','org']]" attrs='{"required":[["fee","!=",0]]}'/> <field name="product_id" onchang="onchange_product"/>
</group> <field name="description"/>
<field name="qty" onchange="onchange_line"/>
<field name="uom_id"/>
<field name="price" onchange="onchange_line"/>
<field name="amount"/>
</list>
</field>
<field name="fee" offset="7"/>
<field name="fee_partner_id" domain="[['type','=','org']]" attrs='{"required":[["fee","!=",0]]}' offset="7"/>
<group span="4" columns="1"> <group span="4" columns="1">
</group> </group>
<separator string="HD Case Treatment Summary"/>
<group span="4" columns="1"> <group span="4" columns="1">
<field name="total"/> <field name="total"/>
<field name="amount"/> <field name="amount"/>

View File

@ -9,7 +9,7 @@
<item string="Treatments" action="clinic_hd_case"/> <item string="Treatments" action="clinic_hd_case"/>
<item string="Dialyzer" action="clinic_dialyzer"/> <item string="Dialyzer" action="clinic_dialyzer"/>
<item string="Reports"> <item string="Reports">
<item string="Report1" action="report1"/> <item string="Report1" action="report_clinic_round"/>
</item> </item>
<item string="Config/Import"> <item string="Config/Import">
<item string="Account (TB, Unpaid AP and AR)" action="report1"/> <item string="Account (TB, Unpaid AP and AR)" action="report1"/>

View File

@ -1,7 +1,7 @@
<form model="clinic.visit" attrs='{"readonly":[["state","in",["cancelled","confirmed"]]]}' show_company="1"> <form model="clinic.visit" attrs='{"readonly":[["state","in",["cancelled","confirmed"]]]}' show_company="1">
<head> <head>
<field name="state"/> <field name="state"/>
<button string="Print" icon="print" action="print_visit"/> <button string="Print" icon="print" action="report_visit_form"/>
<button string="Options" dropdown="1"> <button string="Options" dropdown="1">
<item string="Copy" method="copy"/> <item string="Copy" method="copy"/>
</button> </button>

View File

@ -18,3 +18,4 @@ 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

View File

@ -0,0 +1,27 @@
from netforce.model import Model, fields
class ClinicRound(Model):
_name="clinic.round"
_string="Round"
_fields={
"name": fields.Char("Name",required=True,search=True),
}
def get_data(self,context={}):
lines=[]
for i in range(10):
line={
'no': i,
'doctor': 'Doctor %s'%i,
#......
}
lines.append(line)
data={
'lines': lines,
}
print('data ', data)
return data
ClinicRound.register()

View File

@ -36,7 +36,11 @@ class HDcase(Model):
"per_bp_start": fields.Integer("/Per start"), "per_bp_start": fields.Integer("/Per start"),
"bp_stop": fields.Integer("BP mmHG stop"), "bp_stop": fields.Integer("BP mmHG stop"),
"per_bp_stop": fields.Integer("/Per stop"), "per_bp_stop": fields.Integer("/Per stop"),
"hct": fields.Integer("HCT %"), "epo_tn" : fields.Char("EpoTn (Drug name)"),
"epo_unit" : fields.Integer("EpoUnit (Unit of Used drug)"),
"hct": fields.Integer("HCT %", required=True),
"check_goverment_pay" : fields.Boolean("The Government Pay"),
"check_personal_pay" : fields.Boolean("Pay yourself"),
"state": fields.Selection([("draft","Draft"),("confirmed","Confirmed"),("approved","Approved"),("cancelled","Cancelled"),("paid","Paid")],"Status",required=True), "state": fields.Selection([("draft","Draft"),("confirmed","Confirmed"),("approved","Approved"),("cancelled","Cancelled"),("paid","Paid")],"Status",required=True),
"dialyzers": fields.One2Many("clinic.hd.case.dialyzer","hd_case_id","Dializers"), "dialyzers": fields.One2Many("clinic.hd.case.dialyzer","hd_case_id","Dializers"),
"lines": fields.One2Many("clinic.hd.case.line","hd_case_id","Lines"), "lines": fields.One2Many("clinic.hd.case.line","hd_case_id","Lines"),
@ -150,6 +154,13 @@ class HDcase(Model):
data['total']=total data['total']=total
return data return data
def onchange_htc(self,context={}):
data=context['htc']
total=0.0
if (htc > 39):
data['htc']=total
return data
def cancelled(self,ids,context={}): def cancelled(self,ids,context={}):
obj=self.browse(ids)[0] obj=self.browse(ids)[0]
obj.write({"state":"cancelled"}) obj.write({"state":"cancelled"})

View File

@ -171,4 +171,15 @@ class Visit(Model):
} }
def get_visit_demo(self,context={}):
if not context.get('number'):
return {}
visit_id=int(context['number'])
visit=self.browse(visit_id)
data={
'number' : visit.number
}
return data
Visit.register() Visit.register()

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1 @@
<h1>Hello HBS</h1>