conv_bal
watcha.h 2014-11-25 23:31:29 +07:00
parent 563ef053e7
commit 754999a0db
5 changed files with 28 additions and 30 deletions

View File

@ -89,8 +89,6 @@
<group span="9" form_layout="stacked">
</group>
<group span="3" columns="1">
<!--<field name="total_doctor"/>-->
<!--<field name="total_nurse"/>-->
</group>
</tab>
<tab string="Approval">

View File

@ -38,10 +38,6 @@
<item string="Generate Visit" action="clinic_gen_visit_form"/>
</item>
<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">
<header string="HD CASE"/>
<item string="HD Case Summary" action="clinic_report_hd_case_summary"/>
@ -52,7 +48,7 @@
<header string="LABOR COST"/>
<item string="Nurse Fee Summary" action="clinic_report_nurse_fee_sum"/>
<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 string="Settings">
<item string="Departments" action="clinic_department"/>

View File

@ -32,16 +32,14 @@
<field name="age"/>
<field name="active"/>
</group>
<!--<separator string="Address Information"/>-->
<!--<field name="addresses" view="form_list"/>-->
</tab>
<tab string="Professional Information">
<field name="prof_license" attrs='{"invisible":[["type","in",["personal"]]]}'/>
<field name="prof_license_date" attrs='{"invisible":[["type","in",["personal"]]]}'/>
<field name="prof_license" attrs='{"invisible":[["type","in",["staff"]]]}'/>
<field name="prof_license_date" attrs='{"invisible":[["type","in",["staff"]]]}'/>
<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="base"/>
<field name="wage"/>
<field name="max_cycle"/>
</tab>
<tab string="Note">
@ -64,7 +62,7 @@
</form>
</field>
<field name="moves" nolabel="1">
<field name="rotations" nolabel="1">
<list>
<field name="level_id" domain="[['type','=',parent.type]]"/>
<field name="from_company_id"/>
@ -76,9 +74,7 @@
<field name="note"/>
</list>
</field>
<field name="patients" attrs='{"invisible":[["type","in",["nurse","other"]]]}'/>
<field name="nurse_visits" attrs='{"invisible":[["type","in",["doctor","personal"]]]}'/>
<field name="doctor_visits" attrs='{"invisible":[["type","in",["nurse","personal"]]]}'/>
<field name="patients"/>
<field name="hd_cases"/>
<field name="comments"/>
</related>

View File

@ -5,8 +5,8 @@ class HdCaseStaff(Model):
_fields={
"hd_case_id": fields.Many2One("clinic.hd.case","HdCase",required=True,on_delete="cascade"),
"staff_id": fields.Many2One("clinic.staff","Staff",search=True),
"type": fields.Selection([("doctor","Doctor"),('nurse','Nurse'),("others","Others")],"Type",required=True),
"priop": fields.Selection([("owner","Owner"),('other','Other')],"Priority"),
"type": fields.Selection([("doctor","Doctor"),('nurse','Nurse'),("staff","Staff")],"Type",required=True),
"priop": fields.Selection([("owner","Owner"),('second','Second')],"Priority"),
'note': fields.Char("Note"),
}

View File

@ -24,8 +24,8 @@ class Staff(Model):
res={}
for obj in self.browse(ids):
level_id=None
for move in obj.moves:
level_id=move.level_id.id
for rotate in obj.rotations:
level_id=rotate.level_id.id
res[obj.id]=level_id
return res
@ -42,13 +42,13 @@ class Staff(Model):
def _get_base(self,ids,context={}):
res={}
for obj in self.browse(ids):
base=0
wage=0
max_cycle=0
for mv in obj.moves:
base=mv.wage
max_cycle=mv.max_cycle
for rotate in obj.rotations:
wage=rotate.wage
max_cycle=rotate.max_cycle
res[obj.id]={
'base': base,
'wage': wage,
'max_cycle': max_cycle,
}
return res
@ -86,16 +86,16 @@ class Staff(Model):
'picture': fields.File("Picture"),
'note': fields.Text("Note"),
'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"),
'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),
'hire_date': fields.Date("Hire Date"),
'resign_date': fields.Date("Resign Date"),
"documents": fields.One2Many("document","related_id","Documents"),
"moves": fields.One2Many("clinic.staff.move","staff_id","Staff Movement"),
"cycles": fields.One2Many("clinic.staff.cycle","staff_id","Working Cycles"),
"rotations": fields.One2Many("clinic.staff.rotation","staff_id","Staff Rotation"),
"cycles": fields.One2Many("clinic.staff.cycle","staff_id","Cycles"),
'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(),
}
_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()