conv_bal
watcha.h 2014-11-11 07:51:44 +07:00
parent 0be9ca722c
commit d3e7066fdd
7 changed files with 48 additions and 11 deletions

View File

@ -2,7 +2,7 @@
<field name="string">Personals</field> <field name="string">Personals</field>
<field name="view_cls">multi_view</field> <field name="view_cls">multi_view</field>
<field name="model">clinic.personal</field> <field name="model">clinic.personal</field>
<field name="tabs">[["All",[]],["Archived",[["active","=",false]]],["Personal",[["type","=","personal"]]],["Doctor",[["type","=","doctor"]]],["Nurse",[["type","=","nurse"]]]]</field> <field name="tabs">[["All",[]],["Archived",[["active","=",false]]],["Doctor",[["type","=","doctor"]]],["Nurse",[["type","=","nurse"]]]]</field>
<field name="modes">list,page,form</field> <field name="modes">list,page,form</field>
<field name="menu">clinic_menu</field> <field name="menu">clinic_menu</field>
</action> </action>

View File

@ -35,10 +35,10 @@
<field name="addresses" view="form_list"/> <field name="addresses" view="form_list"/>
</tab> </tab>
<tab string="Professional Information"> <tab string="Professional Information">
<field name="prof_license"/> <field name="prof_license" attrs='{"invisible":[["type","in",["personal"]]]}'/>
<field name="prof_license_date"/> <field name="prof_license_date" attrs='{"invisible":[["type","in",["personal"]]]}'/>
<field name="level_id" domain="[['type','=',type]]"/> <field name="level_id" domain="[['type','=',type]]"/>
<field name="prof_license_expiry"/> <field name="prof_license_expiry" attrs='{"invisible":[["type","in",["personal"]]]}'/>
<field name="moves" nolabel="1"> <field name="moves" nolabel="1">
<list> <list>
<field name="level_id" domain="[['type','=',parent.type]]"/> <field name="level_id" domain="[['type','=',parent.type]]"/>
@ -58,8 +58,8 @@
<related> <related>
<field name="documents"/> <field name="documents"/>
<field name="patients" attrs='{"invisible":[["type","in",["nurse","other"]]]}'/> <field name="patients" attrs='{"invisible":[["type","in",["nurse","other"]]]}'/>
<field name="nurse_visits" attrs='{"invisible":[["type","in",["doctor","other"]]]}'/> <field name="nurse_visits" attrs='{"invisible":[["type","in",["doctor","personal"]]]}'/>
<field name="doctor_visits" attrs='{"invisible":[["type","in",["nurse","other"]]]}'/> <field name="doctor_visits" attrs='{"invisible":[["type","in",["nurse","personal"]]]}'/>
<field name="hd_cases"/> <field name="hd_cases"/>
<field name="comments"/> <field name="comments"/>
</related> </related>

View File

@ -3,6 +3,7 @@
<field name="state"/> <field name="state"/>
<button string="Options" dropdown="1"> <button string="Options" dropdown="1">
<item string="Copy" method="copy"/> <item string="Copy" method="copy"/>
<item string="View Cycle Item" method="view_cycle_item"/>
</button> </button>
</head> </head>
<group form_layout="stacked"> <group form_layout="stacked">

View File

@ -37,6 +37,9 @@ class CycleItem(Model):
} }
_order="sequence" _order="sequence"
_sql_constraints=[
("cycle_item_uniq","unique (cycle_id,date,company_id)","Cycle item should be unique"),
]
def create(self, vals,**kw): def create(self, vals,**kw):
date=vals['date'] date=vals['date']

View File

@ -1,6 +1,6 @@
from datetime import datetime, timedelta from datetime import datetime, timedelta
from netforce.model import Model, fields from netforce.model import Model, fields, get_model
from netforce.access import get_active_company from netforce.access import get_active_company
class Schedule(Model): class Schedule(Model):
@ -45,4 +45,33 @@ class Schedule(Model):
}) })
def view_cycle_item(self,ids,context={}):
obj=self.browse(ids)[0]
item_id=get_model("clinic.cycle.item").search([['cycle_id','=',obj.cycle_id.id],['date','=',obj.time_start[0:10]]])
msg=''
if not item_id:
# XXX
item_id=get_model("clinic.cycle.item").create({
'cycle_id': obj.cycle_id.id,
'date': obj.time_start[0:10],
})
#raise Exception("No found cycle item")
item_nurse_obj=get_model("clinic.cycle.item.nurse")
for nurse in obj.nurses:
item_nurse_obj.create({
'cycle_item_id': item_id,
'nurse_id': nurse.id,
'level_id': nurse.level_id.id,
})
msg='Create Cycle Item successfully'
return {
'next': {
'name': 'clinic_cycle_item',
'mode': 'form',
'active_id': item_id,
},
'flash': msg,
}
Schedule.register() Schedule.register()

View File

@ -64,8 +64,8 @@
<th>หมายเหตุ</th> <th>หมายเหตุ</th>
</thead> </thead>
<tbody> <tbody>
{{#if resign_patients}} {{#if new_patients}}
{{#each resign_patients}} {{#each new_patients}}
<tr> <tr>
<td>{{no}}</td> <td>{{no}}</td>
<td> <td>
@ -94,8 +94,8 @@
<th>หมายเหตุ</th> <th>หมายเหตุ</th>
</thead> </thead>
<tbody> <tbody>
{{#if new_patients}} {{#if resign_patients}}
{{#each new_patients}} {{#each resign_patients}}
<tr> <tr>
<td>{{no}}</td> <td>{{no}}</td>
<td> <td>

View File

@ -1,3 +1,7 @@
======
design visit
design cycle item
====== ======
flow: flow:
planing schedule planing schedule