Merge branch 'master' of dev.netforce.com:netforce-customized/clinic
commit
6a20a3de27
Binary file not shown.
|
@ -43,16 +43,24 @@
|
||||||
<field name="total"/>
|
<field name="total"/>
|
||||||
</list>
|
</list>
|
||||||
</field>
|
</field>
|
||||||
<field name="fee" span="2" offset="7" attrs='{"readonly":[["state","in",["canceled","approved","validate"]]]}'/>
|
<group attrs='{"readonly":[["state","in",["canceled","approved","validate"]]]}'/>
|
||||||
<field name="total" span="2" offset="8"/>
|
<field name="fee" span="2" offset="7"/>
|
||||||
<field name="amount" span="2" offset="8"/>
|
</group>
|
||||||
|
<group attrs='{"readonly":[["state","not in",["canceled","approved","validate"]]]}'/>
|
||||||
|
<field name="fee" span="2" offset="9"/>
|
||||||
|
</group>
|
||||||
|
<field name="total" span="2" offset="9"/>
|
||||||
|
<field name="amount" span="2" offset="9"/>
|
||||||
<foot>
|
<foot>
|
||||||
<button string="Confirm" type="success" method="confirmed" states="draft" />
|
<button string="Confirm" type="success" method="confirmed" states="draft" />
|
||||||
<button string="Approved" type="success" method="approved" states="confirmed"/>
|
<button string="Approved" type="success" method="approved" states="confirmed"/>
|
||||||
<button string="Validate" type="success" method="validate" states="approved" />
|
<button string="Validate" type="success" method="validate" states="approved" />
|
||||||
<button string="Canceled" type="danger" method="canceled" confirm="You are sure to canceled hd case"/>
|
<button string="Canceled" type="danger" method="canceled" confirm="You are sure to canceled hd case"/>
|
||||||
</foot>
|
</foot>
|
||||||
<related>
|
<related>
|
||||||
<field name="comments"/>
|
<field name="invoices" click_action="view_invoice"/>
|
||||||
|
<field name="payments" click_action="view_payment"/>
|
||||||
|
<field name="pickings" click_action="view_picking"/>
|
||||||
|
<field name="comments"/>
|
||||||
</related>
|
</related>
|
||||||
</form>
|
</form>
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
<menu string="Clinic">
|
<menu string="Clinic">
|
||||||
<item string="Dashboard" action="clinic_board"/>
|
<item string="Dashboard" action="clinic_board"/>
|
||||||
<item string="Patient" action="clinic_patient"/>
|
|
||||||
<item string="Doctor" action="clinic_doctor"/>
|
<item string="Doctor" action="clinic_doctor"/>
|
||||||
<item string="Nurse" action="clinic_nurse"/>
|
<item string="Nurse" action="clinic_nurse"/>
|
||||||
|
<item string="Patient" action="clinic_patient"/>
|
||||||
<item string="Visit" action="clinic_visit"/>
|
<item string="Visit" action="clinic_visit"/>
|
||||||
<item string="HD Case Treatment" action="clinic_hd_case"/>
|
<item string="HD Case Treatment" action="clinic_hd_case"/>
|
||||||
<item string="Dialyzer" action="clinic_dialyzer"/>
|
<item string="Dialyzer" action="clinic_dialyzer"/>
|
||||||
|
|
|
@ -4,7 +4,7 @@ import time
|
||||||
from netforce.access import get_active_user,set_active_user
|
from netforce.access import get_active_user,set_active_user
|
||||||
from netforce.access import get_active_company
|
from netforce.access import get_active_company
|
||||||
|
|
||||||
class Hdcase(Model):
|
class HDcase(Model):
|
||||||
_name="clinic.hd.case"
|
_name="clinic.hd.case"
|
||||||
_string="HD Case Treatment"
|
_string="HD Case Treatment"
|
||||||
_audit_log=True
|
_audit_log=True
|
||||||
|
@ -34,6 +34,9 @@ class Hdcase(Model):
|
||||||
"amount": fields.Float("Amount",function="get_total",readonly=True,function_multi=True),
|
"amount": fields.Float("Amount",function="get_total",readonly=True,function_multi=True),
|
||||||
"total": fields.Float("Total",function="get_total",readonly=True,function_multi=True),
|
"total": fields.Float("Total",function="get_total",readonly=True,function_multi=True),
|
||||||
"reconcile_id": fields.Many2One("account.reconcile","Reconcile Id",readonly=True),
|
"reconcile_id": fields.Many2One("account.reconcile","Reconcile Id",readonly=True),
|
||||||
|
"invoices": fields.One2Many("account.invoice","related_id","Invoices"),
|
||||||
|
"pickings": fields.One2Many("stock.picking","related_id","Pickings"),
|
||||||
|
"payments": fields.One2Many("account.payment","related_id","Payments"),
|
||||||
}
|
}
|
||||||
|
|
||||||
def _get_number(self,context={}):
|
def _get_number(self,context={}):
|
||||||
|
@ -80,7 +83,6 @@ class Hdcase(Model):
|
||||||
obj=self.browse(ids)[0]
|
obj=self.browse(ids)[0]
|
||||||
obj.write({"state":"canceled"})
|
obj.write({"state":"canceled"})
|
||||||
|
|
||||||
|
|
||||||
def confirmed(self,ids,context={}):
|
def confirmed(self,ids,context={}):
|
||||||
obj=self.browse(ids)[0]
|
obj=self.browse(ids)[0]
|
||||||
obj.write({"state":"confirmed"})
|
obj.write({"state":"confirmed"})
|
||||||
|
@ -193,9 +195,9 @@ class Hdcase(Model):
|
||||||
for obj in self.browse(ids):
|
for obj in self.browse(ids):
|
||||||
total=0
|
total=0
|
||||||
amt=0
|
amt=0
|
||||||
fee=obj.fee
|
fee=obj.fee or 0
|
||||||
for line in obj.lines_detail:
|
for line in obj.lines_detail:
|
||||||
total+=line.total
|
total+=line.total or 0
|
||||||
amt=total+fee
|
amt=total+fee
|
||||||
vals[obj.id]={
|
vals[obj.id]={
|
||||||
"total": total,
|
"total": total,
|
||||||
|
@ -203,4 +205,4 @@ class Hdcase(Model):
|
||||||
}
|
}
|
||||||
return vals
|
return vals
|
||||||
|
|
||||||
Hdcase.register()
|
HDcase.register()
|
||||||
|
|
|
@ -40,7 +40,7 @@ class Patient(Model):
|
||||||
"card_type": fields.Selection([("iden_id","Identity Card"),("passport","Passport")],"Card Type",required=True),
|
"card_type": fields.Selection([("iden_id","Identity Card"),("passport","Passport")],"Card Type",required=True),
|
||||||
'iden_id' : fields.Char("Card No."),
|
'iden_id' : fields.Char("Card No."),
|
||||||
"app_no": fields.Char("Application No."),
|
"app_no": fields.Char("Application No."),
|
||||||
"salary": fields.Selection([("20000","5,001-20,000"),("50000","20,001-50,000"),("100000","50,001-100,000"),("100001","100,000+")], "Salary"),
|
"salary": fields.Selection([["20000","5,001-20,000"],["50000","20,001-50,000"],["100000","50,001-100,000"],["100001","100,000+"]], "Salary"),
|
||||||
'exp_id' : fields.Date("Expiry Date"),
|
'exp_id' : fields.Date("Expiry Date"),
|
||||||
"state": fields.Selection([("draft","Draft"),("active","Active"),("deactive","Deactive")],"Status",required=False),
|
"state": fields.Selection([("draft","Draft"),("active","Active"),("deactive","Deactive")],"Status",required=False),
|
||||||
"addresses": fields.One2Many("address","related_id","Addresses"),
|
"addresses": fields.One2Many("address","related_id","Addresses"),
|
||||||
|
@ -144,10 +144,15 @@ class Patient(Model):
|
||||||
}
|
}
|
||||||
_order="date desc,number desc"
|
_order="date desc,number desc"
|
||||||
|
|
||||||
|
def name_get(self,ids,context={}):
|
||||||
|
vals=[]
|
||||||
|
for obj in self.browse(ids):
|
||||||
|
name='%s %s'%(obj.first_name or "", obj.last_name or "")
|
||||||
|
vals.append((obj.id,name))
|
||||||
|
return vals
|
||||||
|
|
||||||
def void(self,ids,context={}):
|
def void(self,ids,context={}):
|
||||||
obj=self.browse(ids)[0]
|
obj=self.browse(ids)[0]
|
||||||
obj.write({"state":"voided"})
|
obj.write({"state":"voided"})
|
||||||
|
|
||||||
|
|
||||||
Patient.register()
|
Patient.register()
|
||||||
|
|
Loading…
Reference in New Issue