onchange date
parent
a2136d09e9
commit
4fd53c26b9
|
@ -12,7 +12,7 @@
|
|||
<field name="patient_id" span="2" onchange="onchange_patient"/>
|
||||
<field name="patient_type_id" span="2"/>
|
||||
<field name="cycle_id" span="2" required="1" onchange="onchange_cycle"/>
|
||||
<field name="cycle_item_id" span="2" domain="[['cycle_id','=',cycle_id]]"/>
|
||||
<field name="cycle_item_id" span="2" onchange="onchange_cycle_item" domain="[['cycle_id','=',cycle_id]]"/>
|
||||
<field name="visit_id" span="2"/>
|
||||
<field name="branch_id" span="2"/>
|
||||
<field name="department_id" span="2"/>
|
||||
|
@ -23,12 +23,13 @@
|
|||
<tabs>
|
||||
<tab string="General">
|
||||
<group form_layout="form" attrs='{"readonly":[["state","=","completed"]]}'>
|
||||
<field name="time_start" span="2"/>
|
||||
<field name="time_start" onchange="onchange_datestart" span="2"/>
|
||||
<field name="time_stop" span="2"/>
|
||||
<field name="duration" span="2"/>
|
||||
<field name="vascular_acc" span="2"/>
|
||||
<field name="hd_mode" span="2"/>
|
||||
<field name="hd_acc" span="2"/>
|
||||
<field name="date" invisible="1" span="2"/>
|
||||
<newline/>
|
||||
<field name="wt_start" span="2" attrs='{"required":[["state","=","waiting_treatment"]]}'/>
|
||||
<field name="wt_stop" span="2"/>
|
||||
|
|
|
@ -1109,5 +1109,24 @@ class HDCase(Model):
|
|||
'flash': '%s has been approval'%obj.number,
|
||||
}
|
||||
|
||||
def onchange_datestart(self,context={}):
|
||||
data=context['data']
|
||||
data['date']=data['time_start'][0:10]
|
||||
data['time_stop']='%s %s'%(data['date'],data['time_stop'][11:])
|
||||
return data
|
||||
|
||||
def onchange_cycle_item(self,context={}):
|
||||
data=context['data']
|
||||
item=get_model("clinic.cycle.item").browse(data['cycle_item_id'])
|
||||
cycle=item.cycle_id
|
||||
date=item.date
|
||||
time_start='%s %s'%(date,cycle.time_start)
|
||||
time_stop='%s %s'%(date,cycle.time_stop)
|
||||
data['cycle_id']=cycle.id
|
||||
data['date']=date
|
||||
data['time_start']=time_start
|
||||
data['time_stop']=time_stop
|
||||
data['duration']=cycle.duration
|
||||
return data
|
||||
|
||||
HDCase.register()
|
||||
|
|
Loading…
Reference in New Issue