improve
parent
3a13aa1919
commit
f184eb6799
|
@ -0,0 +1,6 @@
|
|||
<action>
|
||||
<field name="string">Copy Cycle Item</field>
|
||||
<field name="view_cls">form_popup</field>
|
||||
<field name="model">clinic.cycle.item.copy</field>
|
||||
<field name="target">_popup</field>
|
||||
</action>
|
|
@ -0,0 +1,16 @@
|
|||
<form model="clinic.cycle.item.copy" title="Load Nurses">
|
||||
<group form_layout="stacked">
|
||||
<field name="choice" onchange="onchange_choice" span="4"/>
|
||||
<field name="item_copy_id" onchange="onchange_item" span="4"/>
|
||||
<field name="schd_copy_id" onchange="onchange_schd" span="4"/>
|
||||
<field name="cycle_item_id" span="2" invisible="1"/>
|
||||
</group>
|
||||
<field name="lines" nolabel="1">
|
||||
<list noadd="1">
|
||||
<field name="nurse_id"/>
|
||||
</list>
|
||||
</field>
|
||||
<foot>
|
||||
<button string="Load" type="success" method="load"/>
|
||||
</foot>
|
||||
</form>
|
|
@ -2,7 +2,8 @@
|
|||
<head>
|
||||
<field name="state"/>
|
||||
<button string="Options" dropdown="1">
|
||||
<item string="Load Nurses" method="load_nurse_from_schedule" states='draft'/>
|
||||
<!--<item string="Load Nurses" method="load_nurse_from_schedule" states='draft'/>-->
|
||||
<item string="Load Nurses" method="cycle_item_copy" states='draft'/>
|
||||
<item string="Load HDCase" method="update_hdcase" states="draft" />
|
||||
<item string="View Schedule" method="view_schedule"/>
|
||||
<item string="To Draft" method="to_draft" states="validated" />
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
<field name="cycle_id"/>
|
||||
<field name="patient_id"/>
|
||||
<field name="department_id"/>
|
||||
<!--<field name="visit_id" invisible="1"/>-->
|
||||
</list>
|
||||
</field>
|
||||
<foot>
|
||||
|
|
|
@ -37,6 +37,8 @@ from . import dialyzer
|
|||
from . import cycle
|
||||
from . import cycle_item
|
||||
from . import cycle_item_line
|
||||
from . import cycle_item_copy
|
||||
from . import cycle_item_copy_line
|
||||
from . import gen_visit
|
||||
from . import gen_visit_line
|
||||
from . import gen_visit_time
|
||||
|
|
|
@ -248,5 +248,14 @@ class CycleItem(Model):
|
|||
},
|
||||
'flash': 'Update HDCase successfully',
|
||||
}
|
||||
|
||||
def cycle_item_copy(self,ids,context={}):
|
||||
obj=self.browse(ids)[0]
|
||||
return {
|
||||
'next': {
|
||||
'name': 'clinic_cycle_item_copy',
|
||||
'refer_id': obj.id,
|
||||
},
|
||||
}
|
||||
|
||||
CycleItem.register()
|
||||
|
|
|
@ -0,0 +1,38 @@
|
|||
from netforce.model import Model, fields, get_model
|
||||
|
||||
class CycleItemCopy(Model):
|
||||
_name="clinic.cycle.item.copy"
|
||||
_transient=True
|
||||
|
||||
_fields={
|
||||
"cycle_item_id": fields.Many2One("clinic.cycle.item","Cycle Item",required=True,on_delete="cascade"),
|
||||
'choice': fields.Selection([['item','Cycle Item'],['schd','Schedule']],'Choice'),
|
||||
"item_copy_id": fields.Many2One("clinic.cycle.item","Cycle Item"),
|
||||
"schd_copy_id": fields.Many2One("clinic.schedule","Schedule"),
|
||||
'lines': fields.One2Many("clinic.cycle.item.copy.line","item_copy_id","Lines"),
|
||||
}
|
||||
|
||||
def _get_cycle_item_id(self,context={}):
|
||||
refer_id=context.get("refer_id")
|
||||
if not refer_id:
|
||||
return None
|
||||
return int(refer_id)
|
||||
|
||||
_defaults={
|
||||
'cycle_item_id': _get_cycle_item_id,
|
||||
'choice': 'item',
|
||||
}
|
||||
|
||||
def onchange_choice(self,context={}):
|
||||
data=context['data']
|
||||
return data
|
||||
|
||||
def onchange_item(self,context={}):
|
||||
data=context['data']
|
||||
return data
|
||||
|
||||
def onchange_schd(self,context={}):
|
||||
data=context['data']
|
||||
return data
|
||||
|
||||
CycleItemCopy.register()
|
|
@ -0,0 +1,13 @@
|
|||
from netforce.model import Model, fields, get_model
|
||||
|
||||
class CycleItemCopyLine(Model):
|
||||
_name="clinic.cycle.item.copy.line"
|
||||
_transient=True
|
||||
|
||||
_fields={
|
||||
"item_copy_id": fields.Many2One("clinic.cycle.item.copy","Copy Item",required=True,on_delete="cascade"),
|
||||
'nurse_id': fields.Many2One("clinic.staff","Nurse",domain=[['type','=','nurse']]),
|
||||
}
|
||||
|
||||
|
||||
CycleItemCopyLine.register()
|
|
@ -6,7 +6,7 @@ todo:
|
|||
- modify message of log -> Ask DJ
|
||||
- show image of staff
|
||||
- copy old nurse from previous cycle item
|
||||
- multi confirm ****
|
||||
- multi confirm on visit board **** -> ok
|
||||
=======
|
||||
generate visit ใหม่ -> ok
|
||||
popup select dyalyzer -> ok
|
||||
|
|
Loading…
Reference in New Issue