visit report dialy

conv_bal
watcha.h 2014-11-02 10:03:28 +07:00
parent b0680dac69
commit 1cd49dab69
6 changed files with 20 additions and 9 deletions

View File

@ -4,8 +4,7 @@
<field name="model">clinic.visit</field>
<!--<field name="domain">[["order_id.state","in",["confirmed","done"]]]</field>-->
<field name="group_fields">visit_date</field>
<field name="group_select">cycle_id</field>
<!--<field name="group_select">partner_id,product_id,user_id,order_id</field>-->
<!--<field name="sum_fields">amount</field>-->
<field name="group_select">visit_date,cycle_id</field>
<field name="view_xml">clinic_visit_dialy</field>
<field name="menu">clinic_menu</field>
</action>

View File

@ -0,0 +1,9 @@
<list model="clinic.visit" colors='{"#cfc":[["state","=","confirmed"]],"#bcbbb9":[["state","=","cancelled"]]}'>
<field name="number"/>
<field name="visit_date"/>
<field name="cycle_id"/>
<field name="patient_id"/>
<field name="doctor_id"/>
<field name="department_id"/>
<field name="state"/>
</list>

View File

@ -22,6 +22,7 @@
<field name="time_stop"/>
<field name="doctor_id"/>
<field name="nurse_id"/>
<field name="visit_date"/>
</group>
</tab>
</tabs>

View File

@ -130,6 +130,7 @@ class GenVisit(Model):
schedules={}
for patient_id in patients:
patient=get_model("clinic.patient").browse(patient_id)
ntoday=1
day_total=(date_to-date_from).days+ntoday
for weekday in days:
@ -149,7 +150,7 @@ class GenVisit(Model):
ttime_stop="%s %s" % (tmp.strftime(FMT_DATE),date_to.strftime(FMT_DATETIME)[11:])
vals={
'patient_id': patient_id,
'doctor_id': obj.doctor_id.id,
'doctor_id': obj.doctor_id.id or patient.doctor_id.id,
'department_id': obj.department_id.id,
'cycle_id': obj.cycle_id.id,
'time_start': ttime_start,

View File

@ -84,6 +84,7 @@ class Visit(Model):
"company_id": lambda *a: get_active_company(),
'nurse_id': _get_nurse,
}
_order="sequence"
def confirm(self,ids,context={}):
@ -317,10 +318,10 @@ class Visit(Model):
}
def write(self,ids,vals,**kw):
cycle_id=vals['cycle_id']
cycle=get_model("clinic.cycle").browse(cycle_id)
vals['sequence']='%s-%s'%(vals['time_start'][0:10],cycle.sequence) #date-sequence
vals['visit_date']=vals['time_start'][0:10]
obj=self.browse(ids)[0]
cycle=obj.cycle_id
vals['sequence']='%s-%s'%(obj.time_start[0:10],cycle.sequence) #date-sequence
vals['visit_date']=obj.time_start[0:10]
super().write(ids,vals,**kw)
Visit.register()

View File

@ -2,7 +2,7 @@ missing:
- search calendar
- color calendar
- can not move calendar's schedule
- order's visit report dialy
dashboard
: hd summary report -> click and go direct
cycle item: