fix bug
parent
3633b10d77
commit
ba6adec611
|
@ -5,6 +5,7 @@
|
|||
<item string="Load Nurses" method="load_nurse_from_schedule" states='draft'/>
|
||||
<item string="Compute Labor Cost" method="compute" states='draft'/>
|
||||
<item string="View Schedule" method="view_schedule"/>
|
||||
<item string="View Cycle Dialy" method="view_cycle_dialy"/>
|
||||
</button>
|
||||
</head>
|
||||
|
||||
|
@ -30,7 +31,7 @@
|
|||
<field name="level_id"/>
|
||||
<field name="qty"/>
|
||||
<field name="formular_org" readonly="1"/>
|
||||
<field name="formular"/>
|
||||
<field name="formular" readonly="1"/>
|
||||
<field name="amount"/>
|
||||
</list>
|
||||
</field>
|
||||
|
|
|
@ -18,8 +18,8 @@
|
|||
<item string="Patients" action="clinic_patient"/>
|
||||
<item string="Dialyzers" action="clinic_dialyzer"/>
|
||||
<divider/>
|
||||
<header string="PATIENT SETTINGS"/>
|
||||
<item string="Patient Categories" action="clinic_patient_categ"/>
|
||||
<header string="SETTINGS"/>
|
||||
<item string="Categories" action="clinic_patient_categ"/>
|
||||
<item string="Cause Chronics" action="clinic_cause_chronic"/>
|
||||
<item string="Comorbidities" action="clinic_comorbidity"/>
|
||||
<item string="Graduations" action="clinic_grade"/>
|
||||
|
|
|
@ -231,7 +231,7 @@ class CycleItem(Model):
|
|||
'mode': 'form',
|
||||
'active_id': cycle_dialy.id,
|
||||
},
|
||||
'flash': 'Cycle Item has been confirmed, please see detail of cost below.',
|
||||
'flash': 'Cycle Item has been validated, please see the detail of cost below.',
|
||||
}
|
||||
|
||||
def to_draft(self,ids,context={}):
|
||||
|
@ -254,8 +254,11 @@ class CycleItem(Model):
|
|||
}
|
||||
}
|
||||
levels.update(vals)
|
||||
for nurse in obj.nurses:
|
||||
level=nurse.level_id
|
||||
|
||||
for ns in obj.nurses:
|
||||
level=ns.level_id
|
||||
if not level:
|
||||
raise Exception("Please specify level for %s"%ns.nurse_id.name)
|
||||
levels[level.id]['total']+=1
|
||||
|
||||
st_levels={}
|
||||
|
@ -404,6 +407,18 @@ class CycleItem(Model):
|
|||
}
|
||||
}
|
||||
|
||||
def view_cycle_dialy(self,ids,context={}):
|
||||
obj=self.browse(ids)[0]
|
||||
if not obj.cycle_dialy_id:
|
||||
raise Exception("Please validate cycle item")
|
||||
return {
|
||||
'next': {
|
||||
'name': 'clinic_cycle_dialy',
|
||||
'mode': 'form',
|
||||
'active_id': obj.cycle_dialy_id.id,
|
||||
}
|
||||
}
|
||||
|
||||
def load_nurse_from_schedule(self,ids,context={}):
|
||||
obj=self.browse(ids)[0]
|
||||
#TODO check cycle number & date from schedule
|
||||
|
|
|
@ -107,17 +107,19 @@ class Schedule(Model):
|
|||
for line in obj.lines:
|
||||
nurse=line.nurse_id
|
||||
cycle=line.cycle_id
|
||||
item_ids=get_model("clinic.cycle.item").search([['date','=',date],['cycle_id','=',cycle.id],['state','=','draft']])
|
||||
if item_ids:
|
||||
item_id=item_ids[0]
|
||||
if not items.get(item_id):
|
||||
items[item_id]=[]
|
||||
items[item_id].append(('create',{
|
||||
item_objs=get_model("clinic.cycle.item").search_browse([['date','=',date],['cycle_id','=',cycle.id]])
|
||||
if item_objs:
|
||||
item=item_objs[0]
|
||||
if item.state!='draft':
|
||||
continue
|
||||
if not items.get(item.id):
|
||||
items[item.id]=[]
|
||||
items[item.id].append(('create',{
|
||||
'nurse_id': nurse.id,
|
||||
'level_id': nurse.level_id.id,
|
||||
}))
|
||||
line.write({
|
||||
'cycle_item_id': item_id,
|
||||
'cycle_item_id': item.id,
|
||||
})
|
||||
cycles.update({cycle.name})
|
||||
else:
|
||||
|
|
|
@ -14,7 +14,7 @@ class SettingLevel(Model):
|
|||
"setting_id": fields.Many2One("clinic.setting","Setting"),
|
||||
"level_id": fields.Many2One("clinic.staff.level","Level",domain=[['type','=','nurse']]),
|
||||
'var_a': fields.Char("Ax"),
|
||||
"op": fields.Selection([["+","+"],["-","-"],["*","*"],["/","/"]],"Operation"),
|
||||
"op": fields.Selection([["+","+"],["-","-"]],"Operation"),
|
||||
'var_b': fields.Char("B"),
|
||||
'formular': fields.Text("Formular (Ax op B)",function="_get_formular"),
|
||||
}
|
||||
|
|
|
@ -6,7 +6,7 @@ class SettingProduct(Model):
|
|||
|
||||
_fields={
|
||||
"setting_id": fields.Many2One("clinic.setting","Setting"),
|
||||
"type": fields.Selection([("fee","FEE"),("others","Others")],"Type",required=True),
|
||||
"type": fields.Selection([("fee","Fee"),("others","Others")],"Type",required=True),
|
||||
"patient_type": fields.Selection([("sc","Social Security"),("uc","UC"),("others","Others")],"Patient Type",required=True),
|
||||
'uom_id': fields.Many2One("uom","UOM", required=True),
|
||||
"product_id": fields.Many2One("product","Product"),
|
||||
|
|
Loading…
Reference in New Issue