conv_bal
Test server 2014-10-01 17:52:21 +07:00
parent 918d2f1353
commit bc40c35d9f
16 changed files with 105 additions and 168 deletions

View File

@ -2,7 +2,7 @@
<field name="string">Doctors</field>
<field name="view_cls">multi_view</field>
<field name="model">clinic.doctor</field>
<field name="tabs">[["All",[]],["Draft",[["state","=","draft"]]],["Active",[["state","=","active"]]],["Deactive",[["state","=","deactive"]]]]</field>
<field name="tabs">[["All",[]],["Temporaly",[["type","=","temporary"]]],["Permanent",[["type","=","permanent"]]]]</field>
<field name="modes">list,page,form</field>
<field name="menu">clinic_menu</field>
</action>

View File

@ -2,7 +2,7 @@
<field name="string">Nurses</field>
<field name="view_cls">multi_view</field>
<field name="model">clinic.nurse</field>
<field name="tabs">[["All",[]],["Draft",[["state","=","draft"]]],["Active",[["state","=","active"]]],["Deactive",[["state","=","deactive"]]]]</field>
<field name="tabs">[["All",[]],["Temporaly",[["type","=","temporary"]]],["Permanent",[["type","=","permanent"]]]]</field>
<field name="modes">list,page,form</field>
<field name="menu">clinic_menu</field>
</action>

View File

@ -0,0 +1,5 @@
<action>
<field name="type">method</field>
<field name="model">clinic.hd.case</field>
<field name="method">view_hdcase</field>
</action>

View File

@ -1,43 +1,26 @@
<form model="clinic.doctor">
<head>
<field name="state"/>
<field name="type"/>
<button string="Options" dropdown="1">
<item string="Send Confirm visit"/>
<item string="Item1"/>
</button>
</head>
<separator string="Doctor Information"/>
<group span="12" colunm="2">
<field name="number"/>
</group>
<group span="12" colunm="2">
<field name="first_name"/>
<field name="last_name"/>
</group>
<group span="12" colunm="2">
<field name="name"/>
<field name="card_id"/>
<field name="card_expire"/>
</group>
<field name="number2"/>
<field name="licen_issued"/>
<field name="birthday" span="12"/>
<group span="12" colunm="2">
<field name="cert_no"/>
<field name="cert_date"/>
<field name="birthday"/>
<field name="department_id"/>
<field name="telephone"/>
<field name="mobile"/>
<field name="department_id"/>
</group>
<field name="type"/>
<related>
<field name="addresses"/>
</related>
<related>
<field name="visits"/>
</related>
<related>
<field name="hd_cases"/>
</related>
<related>
<field name="patients"/>
</related>
<related>
<field name="comments"/>
<field name="addresses"/>
<field name="visits"/>
<field name="hd_cases"/>
<field name="patients"/>
<field name="comments"/>
</related>
</form>

View File

@ -1,7 +1,5 @@
<list model="clinic.doctor">
<field name="number"/>
<field name="first_name"/>
<field name="last_name"/>
<field name="date"/>
<field name="state"/>
<field name="name"/>
<field name="type"/>
</list>

View File

@ -1,42 +1,26 @@
<form model="clinic.nurse">
<head>
<field name="state"/>
<field name="type"/>
<button string="Options" dropdown="1">
<item string="Item1"/>
</button>
</head>
<group span="12" colunm="2">
<field name="number"/>
</group>
<group span="12" colunm="2">
<field name="name"/>
<field name="lname"/>
</group>
<group span="12" colunm="2">
<field name="card_id"/>
<field name="card_expire"/>
</group>
<field name="number2"/>
<field name="licen_issued"/>
<field name="birthday" span="12"/>
<group span="12" colunm="2">
<field name="telephone"/>
<field name="mobile"/>
<field name="department_id"/>
</group>
<field name="number"/>
<field name="name"/>
<field name="card_id"/>
<field name="card_expire"/>
<field name="cert_no"/>
<field name="cert_date"/>
<field name="birthday"/>
<field name="department_id"/>
<field name="telephone"/>
<field name="mobile"/>
<field name="type"/>
<related>
<field name="addresses"/>
</related>
<related>
<field name="visits"/>
</related>
<related>
<field name="hd_cases"/>
</related>
<related>
<field name="patients"/>
</related>
<related>
<field name="comments"/>
<field name="addresses"/>
<field name="visits"/>
<field name="hd_cases"/>
<field name="patients"/>
<field name="comments"/>
</related>
</form>

View File

@ -1,5 +1,5 @@
<list model="clinic.nurse">
<field name="number"/>
<field name="name"/>
<field name="state"/>
<field name="type"/>
</list>

View File

@ -7,40 +7,25 @@
</head>
<tabs>
<tab string="Patient's Data">
<group span="12" colunm="1">
<field name="type"/>
</group>
<group span="12" colunm="1">
<field name="number"/>
<field name="date"/>
</group>
<group span="12" colunm="2">
<field name="first_name"/>
<field name="last_name"/>
</group>
<group span="12" colunm="2">
<field name="birthday"/>
<field name="age"/>
</group>
<group span="12" colunm="2">
<field name="card_type"/>
</group>
<group span="12" colunm="2">
<field name="iden_id"/>
<field name="exp_id"/>
</group>
<field name="number"/>
<field name="type"/>
<field name="reg_date"/>
<field name="name"/>
<field name="birthday"/>
<field name="age"/>
<field name="card_type"/>
<field name="card_no"/>
<field name="exp_date"/>
<field name="telephone"/>
<field name="mobile"/>
<field name="gender" span="12"/>
<field name="marital_status" span="12"/>
<group span="12" colunm="2">
<field name="nationality"/>
<field name="race"/>
</group>
<field name="graduation" span="12"/>
<field name="job" span="12"/>
<field name="weight" span="12"/>
<field name="height" span="12"/>
<field name="gender"/>
<field name="marital_status"/>
<field name="nationality"/>
<field name="race"/>
<field name="graduation"/>
<field name="job"/>
<field name="weight"/>
<field name="height"/>
</tab>
<tab string="Patient's Data +">
<field name="smoke" span="12"/>
@ -113,15 +98,9 @@
</tab>
</tabs>
<related>
<field name="addresses"/>
</related>
<related>
<field name="visits"/>
</related>
<related>
<field name="hd_cases"/>
</related>
<related>
<field name="comments"/>
<field name="addresses"/>
<field name="hd_cases"/>
<field name="visits"/>
<field name="comments"/>
</related>
</form>

View File

@ -1,7 +1,6 @@
<list model="clinic.patient">
<field name="number"/>
<field name="first_name"/>
<field name="last_name"/>
<field name="date"/>
<field name="state"/>
<field name="name"/>
<field name="reg_date"/>
<field name="type"/>
</list>

View File

@ -10,7 +10,7 @@
<separator string="Visit Info"/>
<field name="number"/>
<field name="department"/>
<field name="date"/>
<field name="visit_date"/>
<field name="cycle"/>
<field name="patient_id"/>
<field name="doctor_id"/>

View File

@ -1,6 +1,6 @@
<list model="clinic.visit">
<field name="number"/>
<field name="date"/>
<field name="visit_date"/>
<field name="cycle"/>
<field name="patient_id"/>
<field name="doctor_id"/>

View File

@ -7,33 +7,29 @@ class Doctor(Model):
_name="clinic.doctor"
_string="Doctor"
_audit_log=True
_name_field="name"
_multi_company=True
_fields={
"number": fields.Char("Doctor No.",required=True,search=True),
"first_name": fields.Char("First name",required=True,search=True),
"last_name" : fields.Char("Last name",required=False),
"date": fields.Date("Create Date",required=True,search=True),
"name": fields.Char("Name",required=True,search=True),
"card_id" : fields.Char("Identity ID"),
"card_expire" : fields.Date("Expire Date"),
"birthday": fields.Date("Date of birth",required=False,search=True),
"telephone": fields.Char("Telephone",required=False,search=True),
"department": fields.Selection([("temporary","Temporary"),("permanent","Permanent")], "Dapartment"),
"birthday": fields.Date("Date of Birth",search=True),
"telephone": fields.Char("Telephone",search=True),
"type": fields.Selection([("temporary","Temporary"),("permanent","Permanent")],"Type"),
"mobile": fields.Char("Mobile",required=False,search=True),
#"licen" : fields.char("licens medicine No."),
"number2" : fields.Char("Certificate No."),
"licen_issued" : fields.Date("Issued on"),
"cert_no" : fields.Char("Certificate No."),
"cert_date" : fields.Date("Certificate Date"),
"birthday": fields.Date("BirthDay",search=True),
"telephone": fields.Char("Telephone",search=True),
"department_id": fields.Many2One("clinic.department", "Department",search=True),
"mobile": fields.Char("Mobile",search=True),
"state": fields.Selection([("draft","Draft"),("active","Active"),("deactive","Deactive")],"Status"),
"addresses" : fields.One2Many("address","related_id","Addresses"),
"comments" : fields.One2Many("message","related_id","Comments"),
"patients" : fields.Many2Many("clinic.patient","Patients"),
"visits" : fields.One2Many("clinic.visit","doctor_id","Visits"),
"hd_cases" : fields.One2Many("clinic.hd.case","doctor_id","HD Cases"),
"company_id" : fields.Many2One("company","Company"),
"addresses": fields.One2Many("address","related_id","Addresses"),
"comments": fields.One2Many("message","related_id","Comments"),
"patients": fields.Many2Many("clinic.patient","Patients"),
"visits": fields.One2Many("clinic.visit","nurse_id","Visits"),
"hd_cases": fields.One2Many("clinic.hd.case","nurse_id","HD cases"),
"company_id": fields.Many2One("company","Company"),
}
def _get_number(self,context={}):
@ -44,26 +40,21 @@ class Doctor(Model):
res=self.search([["number","=",num]])
if not res:
return num
get_model("sequence") .increment("sale_order")
get_model("sequence").increment("sale_order")
_defaults={
"state": "draft",
"type": "temporary",
"date": lambda *a: time.strftime("%Y-%m-%d"),
"number": _get_number,
"company_id": lambda *a: get_active_company(),
}
_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={}):
obj=self.browse(ids)[0]
obj.write({"state":"voided "})
obj.write({"state":"voided"})
Doctor.register()

View File

@ -205,4 +205,12 @@ class HDcase(Model):
}
return vals
def view_hdcase(self,ids,context={}):
return {
'name': 'clinic_hd_case',
'mode': 'form',
'form_view_xml': 'clinic_hd_case_form',
'active_id': ids[0],
}
HDcase.register()

View File

@ -1,7 +1,6 @@
from netforce.model import Model, fields, get_model
from netforce.utils import get_data_path
import time
from netforce.access import get_active_user
from netforce.model import Model, fields, get_model
from netforce.access import get_active_company
class Nurse(Model):
@ -12,17 +11,15 @@ class Nurse(Model):
_multi_company=True
_fields={
"number": fields.Char("Nurse No.",required=True,search=True),
"name": fields.Char("First name",required=True,search=True),
#"last_name" : fields.char("Last name"),
"lname" : fields.Char("Last name"),
"name": fields.Char("Name",required=True,search=True),
"card_id" : fields.Char("Identity ID"),
"card_expire" : fields.Date("Expire Date"),
"birthday": fields.Date("Date of Birth",search=True),
"telephone": fields.Char("Telephone",search=True),
"department": fields.Selection([("temporary","Temporary"),("permanent","Permanent")],"Department"),
"type": fields.Selection([("temporary","Temporary"),("permanent","Permanent")],"Type"),
"mobile": fields.Char("Mobile",required=False,search=True),
"number2" : fields.Char("Certificate No."),
"licen_issued" : fields.Date("Issued on"),
"cert_no" : fields.Char("Certificate No."),
"cert_date" : fields.Date("Certificate Date"),
"birthday": fields.Date("BirthDay",search=True),
"telephone": fields.Char("Telephone",search=True),
"department_id": fields.Many2One("clinic.department", "Department",search=True),
@ -48,7 +45,7 @@ class Nurse(Model):
_defaults={
"state": "draft",
"type": "temporary",
"date": lambda *a: time.strftime("%Y-%m-%d"),
"number": _get_number,
"company_id": lambda *a: get_active_company(),

View File

@ -1,14 +1,12 @@
from netforce.model import Model, fields, get_model
from netforce.utils import get_data_path
import time
from netforce.access import get_active_user
from netforce.model import Model, fields, get_model
from netforce.access import get_active_company
class Patient(Model):
_name="clinic.patient"
_string="Patient"
_audit_log=True
_name_field="name"
_multi_company=True
def _get_age(self,ids,context):
@ -23,11 +21,9 @@ class Patient(Model):
return res # -> {1: 30, 2: 45,.....}
_fields={
#Patient's Data
"number": fields.Char("Patient ID",required=True,search=True),
"first_name": fields.Char("First Name",required=True,search=True),
"last_name": fields.Char("Last Name",required=False,search=True),
"date": fields.Date("Create Date",required=False,search=True),
"name": fields.Char("Name",required=True,search=True),
"reg_date": fields.Date("Reg.Date",required=False,search=True),
"birthday": fields.Date("Date of birth",required=False,search=True),
"telephone": fields.Char("Telephone",required=False,search=True),
"mobile": fields.Char("Mobile",required=False,search=True),
@ -38,10 +34,10 @@ class Patient(Model):
"height": fields.Integer("Height (Kg)"),
"type": fields.Selection([("mg","Medical Govement"),("sc","Social Security"),("nhso","NHSO (30฿)"),("personal","Personal"),("other","Other")],"Type of treatment",required=False),
"card_type": fields.Selection([("iden_id","Identity Card"),("passport","Passport")],"Card Type",required=True),
'iden_id' : fields.Char("Card No."),
'card_no' : fields.Char("Card 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"),
'exp_id' : fields.Date("Expiry Date"),
'exp_date' : fields.Date("Expiry Date"),
"state": fields.Selection([("draft","Draft"),("active","Active"),("deactive","Deactive")],"Status",required=False),
"addresses": fields.One2Many("address","related_id","Addresses"),
"gender": fields.Selection([("male","Male"),("female","Female")],"Gender",required=False),

View File

@ -1,7 +1,4 @@
from netforce.model import Model, fields, get_model
from netforce.utils import get_data_path
import time
from netforce.access import get_active_user
from netforce.access import get_active_company
class Visit(Model):
@ -12,10 +9,10 @@ class Visit(Model):
_multi_company=True
_fields={
"number": fields.Char("Number",required=True,search=True),
"patient_id": fields.Many2One("clinic.patient","Patients",required=True,search=True),
"patient_id": fields.Many2One("clinic.patient","Patient",required=True,search=True),
"doctor_id": fields.Many2One("clinic.doctor","Doctor",search=True),
"nurse_id": fields.Many2One("clinic.nurse","Nurse",search=True),
"date": fields.Date("Visit Date",required=True,search=True),
"visit_date": fields.Date("Visit Date",required=True,search=True),
"department": fields.Char("Department",required=False,search=True),
"cycle": fields.Selection([("1","One"),("2","Two"),("3","Tree"),("4","Four")],"Cycle",required=True),
"state": fields.Selection([("pending","Pending"),("confirmed","Confirmed"),("canceled","Canceled")],"Status",required=True),