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="view_cls">multi_view</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="menu">clinic_menu</field>
</action>

View File

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

View File

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

View File

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

View File

@ -1,6 +1,6 @@
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
class Schedule(Model):
@ -44,5 +44,34 @@ class Schedule(Model):
'state': 'draft',
})
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()

View File

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

View File

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