xxxx
parent
563ef053e7
commit
754999a0db
|
@ -89,8 +89,6 @@
|
||||||
<group span="9" form_layout="stacked">
|
<group span="9" form_layout="stacked">
|
||||||
</group>
|
</group>
|
||||||
<group span="3" columns="1">
|
<group span="3" columns="1">
|
||||||
<!--<field name="total_doctor"/>-->
|
|
||||||
<!--<field name="total_nurse"/>-->
|
|
||||||
</group>
|
</group>
|
||||||
</tab>
|
</tab>
|
||||||
<tab string="Approval">
|
<tab string="Approval">
|
||||||
|
|
|
@ -38,10 +38,6 @@
|
||||||
<item string="Generate Visit" action="clinic_gen_visit_form"/>
|
<item string="Generate Visit" action="clinic_gen_visit_form"/>
|
||||||
</item>
|
</item>
|
||||||
<item string="HD Cases" action="clinic_hd_case"/>
|
<item string="HD Cases" action="clinic_hd_case"/>
|
||||||
<!--<item string="HD Cases">-->
|
|
||||||
<!--<item string="HD Cases" action="clinic_hd_case"/>-->
|
|
||||||
<!--<item string="HD Case Dialy" action="clinic_hd_case_dialy"/>-->
|
|
||||||
<!--</item>-->
|
|
||||||
<item string="Reports">
|
<item string="Reports">
|
||||||
<header string="HD CASE"/>
|
<header string="HD CASE"/>
|
||||||
<item string="HD Case Summary" action="clinic_report_hd_case_summary"/>
|
<item string="HD Case Summary" action="clinic_report_hd_case_summary"/>
|
||||||
|
@ -52,7 +48,7 @@
|
||||||
<header string="LABOR COST"/>
|
<header string="LABOR COST"/>
|
||||||
<item string="Nurse Fee Summary" action="clinic_report_nurse_fee_sum"/>
|
<item string="Nurse Fee Summary" action="clinic_report_nurse_fee_sum"/>
|
||||||
<item string="Nurse Fee Detail" action="clinic_report_nurse_fee_detail"/>
|
<item string="Nurse Fee Detail" action="clinic_report_nurse_fee_detail"/>
|
||||||
<item string="Special Nurse" action="clinic_report_nurse_fee_detail"/>
|
<item string="Special Nurse" action="clinic_report_nurse_special"/>
|
||||||
</item>
|
</item>
|
||||||
<item string="Settings">
|
<item string="Settings">
|
||||||
<item string="Departments" action="clinic_department"/>
|
<item string="Departments" action="clinic_department"/>
|
||||||
|
|
|
@ -32,16 +32,14 @@
|
||||||
<field name="age"/>
|
<field name="age"/>
|
||||||
<field name="active"/>
|
<field name="active"/>
|
||||||
</group>
|
</group>
|
||||||
<!--<separator string="Address Information"/>-->
|
|
||||||
<!--<field name="addresses" view="form_list"/>-->
|
|
||||||
</tab>
|
</tab>
|
||||||
<tab string="Professional Information">
|
<tab string="Professional Information">
|
||||||
<field name="prof_license" attrs='{"invisible":[["type","in",["personal"]]]}'/>
|
<field name="prof_license" attrs='{"invisible":[["type","in",["staff"]]]}'/>
|
||||||
<field name="prof_license_date" attrs='{"invisible":[["type","in",["personal"]]]}'/>
|
<field name="prof_license_date" attrs='{"invisible":[["type","in",["staff"]]]}'/>
|
||||||
<field name="level_id" domain="[['type','=',type]]"/>
|
<field name="level_id" domain="[['type','=',type]]"/>
|
||||||
<field name="prof_license_expiry" attrs='{"invisible":[["type","in",["personal"]]]}'/>
|
<field name="prof_license_expiry" attrs='{"invisible":[["type","in",["staff"]]]}'/>
|
||||||
<field name="cycle_id"/>
|
<field name="cycle_id"/>
|
||||||
<field name="base"/>
|
<field name="wage"/>
|
||||||
<field name="max_cycle"/>
|
<field name="max_cycle"/>
|
||||||
</tab>
|
</tab>
|
||||||
<tab string="Note">
|
<tab string="Note">
|
||||||
|
@ -64,7 +62,7 @@
|
||||||
</form>
|
</form>
|
||||||
</field>
|
</field>
|
||||||
|
|
||||||
<field name="moves" nolabel="1">
|
<field name="rotations" nolabel="1">
|
||||||
<list>
|
<list>
|
||||||
<field name="level_id" domain="[['type','=',parent.type]]"/>
|
<field name="level_id" domain="[['type','=',parent.type]]"/>
|
||||||
<field name="from_company_id"/>
|
<field name="from_company_id"/>
|
||||||
|
@ -76,9 +74,7 @@
|
||||||
<field name="note"/>
|
<field name="note"/>
|
||||||
</list>
|
</list>
|
||||||
</field>
|
</field>
|
||||||
<field name="patients" attrs='{"invisible":[["type","in",["nurse","other"]]]}'/>
|
<field name="patients"/>
|
||||||
<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="hd_cases"/>
|
||||||
<field name="comments"/>
|
<field name="comments"/>
|
||||||
</related>
|
</related>
|
||||||
|
|
|
@ -5,8 +5,8 @@ class HdCaseStaff(Model):
|
||||||
_fields={
|
_fields={
|
||||||
"hd_case_id": fields.Many2One("clinic.hd.case","HdCase",required=True,on_delete="cascade"),
|
"hd_case_id": fields.Many2One("clinic.hd.case","HdCase",required=True,on_delete="cascade"),
|
||||||
"staff_id": fields.Many2One("clinic.staff","Staff",search=True),
|
"staff_id": fields.Many2One("clinic.staff","Staff",search=True),
|
||||||
"type": fields.Selection([("doctor","Doctor"),('nurse','Nurse'),("others","Others")],"Type",required=True),
|
"type": fields.Selection([("doctor","Doctor"),('nurse','Nurse'),("staff","Staff")],"Type",required=True),
|
||||||
"priop": fields.Selection([("owner","Owner"),('other','Other')],"Priority"),
|
"priop": fields.Selection([("owner","Owner"),('second','Second')],"Priority"),
|
||||||
'note': fields.Char("Note"),
|
'note': fields.Char("Note"),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -24,8 +24,8 @@ class Staff(Model):
|
||||||
res={}
|
res={}
|
||||||
for obj in self.browse(ids):
|
for obj in self.browse(ids):
|
||||||
level_id=None
|
level_id=None
|
||||||
for move in obj.moves:
|
for rotate in obj.rotations:
|
||||||
level_id=move.level_id.id
|
level_id=rotate.level_id.id
|
||||||
res[obj.id]=level_id
|
res[obj.id]=level_id
|
||||||
return res
|
return res
|
||||||
|
|
||||||
|
@ -42,13 +42,13 @@ class Staff(Model):
|
||||||
def _get_base(self,ids,context={}):
|
def _get_base(self,ids,context={}):
|
||||||
res={}
|
res={}
|
||||||
for obj in self.browse(ids):
|
for obj in self.browse(ids):
|
||||||
base=0
|
wage=0
|
||||||
max_cycle=0
|
max_cycle=0
|
||||||
for mv in obj.moves:
|
for rotate in obj.rotations:
|
||||||
base=mv.wage
|
wage=rotate.wage
|
||||||
max_cycle=mv.max_cycle
|
max_cycle=rotate.max_cycle
|
||||||
res[obj.id]={
|
res[obj.id]={
|
||||||
'base': base,
|
'wage': wage,
|
||||||
'max_cycle': max_cycle,
|
'max_cycle': max_cycle,
|
||||||
}
|
}
|
||||||
return res
|
return res
|
||||||
|
@ -86,16 +86,16 @@ class Staff(Model):
|
||||||
'picture': fields.File("Picture"),
|
'picture': fields.File("Picture"),
|
||||||
'note': fields.Text("Note"),
|
'note': fields.Text("Note"),
|
||||||
'categ_id': fields.Many2One("clinic.staff.categ", "Category"),
|
'categ_id': fields.Many2One("clinic.staff.categ", "Category"),
|
||||||
'level_id': fields.Many2One("clinic.staff.level", "Staff Level", function="_get_level"),
|
'level_id': fields.Many2One("clinic.staff.level", "Level", function="_get_level"),
|
||||||
'active': fields.Boolean("Active"),
|
'active': fields.Boolean("Active"),
|
||||||
'date': fields.Date("Register Date"),
|
'date': fields.Date("Register Date"),
|
||||||
'base': fields.Float("Base Amount", function="_get_base",function_multi=True),
|
'wage': fields.Float("Wage", function="_get_base",function_multi=True),
|
||||||
'max_cycle': fields.Integer("Max Cycle", function="_get_base",function_multi=True),
|
'max_cycle': fields.Integer("Max Cycle", function="_get_base",function_multi=True),
|
||||||
'hire_date': fields.Date("Hire Date"),
|
'hire_date': fields.Date("Hire Date"),
|
||||||
'resign_date': fields.Date("Resign Date"),
|
'resign_date': fields.Date("Resign Date"),
|
||||||
"documents": fields.One2Many("document","related_id","Documents"),
|
"documents": fields.One2Many("document","related_id","Documents"),
|
||||||
"moves": fields.One2Many("clinic.staff.move","staff_id","Staff Movement"),
|
"rotations": fields.One2Many("clinic.staff.rotation","staff_id","Staff Rotation"),
|
||||||
"cycles": fields.One2Many("clinic.staff.cycle","staff_id","Working Cycles"),
|
"cycles": fields.One2Many("clinic.staff.cycle","staff_id","Cycles"),
|
||||||
'cycle_id': fields.Many2One('clinic.cycle','Last Cycle',function="_get_cycle"),
|
'cycle_id': fields.Many2One('clinic.cycle','Last Cycle',function="_get_cycle"),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -124,5 +124,13 @@ class Staff(Model):
|
||||||
"company_id": lambda *a: get_active_company(),
|
"company_id": lambda *a: get_active_company(),
|
||||||
}
|
}
|
||||||
_order="date desc,number desc"
|
_order="date desc,number desc"
|
||||||
|
|
||||||
|
def create(self,vals,**kw):
|
||||||
|
emp_obj=get_model("hr.employee")
|
||||||
|
last_name=vals['name'].split(" ")[-1]
|
||||||
|
emp_ids=emp_obj.search([['last_name','=',last_name]])
|
||||||
|
# TODO create employee automatically
|
||||||
|
new_id=super().create(vals,**kw)
|
||||||
|
return new_id
|
||||||
|
|
||||||
Staff.register()
|
Staff.register()
|
||||||
|
|
Loading…
Reference in New Issue