personal
parent
c8f37e0414
commit
f30b84c6b7
|
@ -2,6 +2,6 @@
|
|||
<field name="string">Patients</field>
|
||||
<field name="view_cls">multi_view</field>
|
||||
<field name="model">clinic.patient</field>
|
||||
<field name="tabs">[["All",[]],["Archived",[["active","=","False"]]],["Medical Goverment",[["type","=","mg"]]],["Social Security",[["type","=","sc"]]],["NHSO(30฿)",[["type","=","nhso"]]],["Personal",[["type","=","personal"]]],["Others",[["type","=","others"]]]]</field>
|
||||
<field name="tabs">[["All",[]],["Archived",[["active","=","False"]]],["Social Security",[["type","=","sc"]]],["NHSO(30฿)",[["type","=","nhso"]]],["Personal",[["type","=","personal"]]],["Others",[["type","=","others"]]]]</field>
|
||||
<field name="menu">clinic_menu</field>
|
||||
</action>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<field name="string">Personals</field>
|
||||
<field name="view_cls">multi_view</field>
|
||||
<field name="model">clinic.personal</field>
|
||||
<field name="tabs">[["All",[]],["Archived",[["active","=",false]]],["Doctor",[["type","=","doctor"]]],["Nurse",[["type","=","nurse"]]]]</field>
|
||||
<field name="tabs">[["All",[]],["Archived",[["active","=",false]]],["Personal",[["type","=","personal"]]],["Doctor",[["type","=","doctor"]]],["Nurse",[["type","=","nurse"]]]]</field>
|
||||
<field name="modes">list,page,form</field>
|
||||
<field name="menu">clinic_menu</field>
|
||||
</action>
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
<action>
|
||||
<field name="string">Personal Moves</field>
|
||||
<field name="view_cls">multi_view</field>
|
||||
<field name="model">clinic.personal.move</field>
|
||||
<field name="menu">clinic_menu</field>
|
||||
</action>
|
|
@ -5,7 +5,10 @@
|
|||
<item string="Doctors" action="clinic_personal" action_options="tab_no=2"/>
|
||||
<item string="Nurses" action="clinic_personal" action_options="tab_no=3"/>
|
||||
<divider/>
|
||||
<header string="PERSONAL SETTINGS"/>
|
||||
<header string="MOVEMENT"/>
|
||||
<item string="Movement" action="clinic_personal_move"/>
|
||||
<divider/>
|
||||
<header string="SETTINGS"/>
|
||||
<item string="Categories" action="clinic_personal_categ"/>
|
||||
<item string="Levels" action="clinic_personal_level"/>
|
||||
</item>
|
||||
|
@ -20,7 +23,6 @@
|
|||
<item string="Graduations" action="clinic_grade"/>
|
||||
<item string="Races" action="clinic_race"/>
|
||||
<item string="Morbidities" action="clinic_morbidity"/>
|
||||
<item string="Nationalities" action="clinic_nation"/>
|
||||
</item>
|
||||
<item string="Cycles">
|
||||
<item string="Cycles" action="clinic_cycle"/>
|
||||
|
@ -37,14 +39,15 @@
|
|||
<item string="HD Cases" action="clinic_hd_case"/>
|
||||
<divider/>
|
||||
<header string="REPORTS"/>
|
||||
<item string="HD Summary" action="clinic_report_hd_case_summary"/>
|
||||
<item string="HD Detail" action="clinic_report_hd_case_detail"/>
|
||||
<item string="HD Case Summary" action="clinic_report_hd_case_summary"/>
|
||||
<item string="HD Case Detail" action="clinic_report_hd_case_detail"/>
|
||||
</item>
|
||||
<item string="Reports">
|
||||
<item string="Medical Summary" action="clinic_report_hd_case_medical"/>
|
||||
<item string="TODO" action="clinic_report_hd_case_medical"/>
|
||||
</item>
|
||||
<item string="Settings">
|
||||
<item string="Departments" action="clinic_department"/>
|
||||
<item string="Nationalities" action="clinic_nation"/>
|
||||
<item string="Clinic Settings" action="clinic_setting"/>
|
||||
</item>
|
||||
</menu>
|
||||
|
|
|
@ -91,6 +91,7 @@
|
|||
</tab>
|
||||
</tabs>
|
||||
<related>
|
||||
<field name="documents"/>
|
||||
<field name="visits"/>
|
||||
<field name="hd_cases"/>
|
||||
<field name="dialyzers"/>
|
||||
|
|
|
@ -11,12 +11,15 @@
|
|||
<field name="type" required="1"/>
|
||||
<field name="number"/>
|
||||
<field name="name"/>
|
||||
<field name="name_eng"/>
|
||||
<field name="nick_name"/>
|
||||
<field name="identification"/>
|
||||
<field name="expiry_card"/>
|
||||
<field name="birthday"/>
|
||||
<field name="gender"/>
|
||||
<field name="department_id"/>
|
||||
<field name="categ_id" domain="[['type','=',type]]"/>
|
||||
<field name="level_id" domain="[['type','=',type]]"/>
|
||||
<field name="nation_id"/>
|
||||
<field name="state"/>
|
||||
</group>
|
||||
<group span="6" columns="1">
|
||||
|
@ -25,6 +28,7 @@
|
|||
<field name="email"/>
|
||||
<field name="mobile"/>
|
||||
<field name="phone"/>
|
||||
<field name="age"/>
|
||||
<field name="active"/>
|
||||
</group>
|
||||
<separator string="Address Information"/>
|
||||
|
@ -33,13 +37,26 @@
|
|||
<tab string="Professional Information">
|
||||
<field name="prof_license"/>
|
||||
<field name="prof_license_date"/>
|
||||
<field name="base"/>
|
||||
<field name="level_id" domain="[['type','=',type]]"/>
|
||||
<field name="prof_license_expiry"/>
|
||||
<field name="moves" nolabel="1">
|
||||
<list>
|
||||
<field name="level_id" domain="[['type','=',parent.type]]"/>
|
||||
<field name="from_company_id"/>
|
||||
<field name="to_company_id"/>
|
||||
<field name="hire_date"/>
|
||||
<field name="resign_date"/>
|
||||
<field name="wage"/>
|
||||
<field name="note"/>
|
||||
</list>
|
||||
</field>
|
||||
</tab>
|
||||
<tab string="Note">
|
||||
<field name="note" nolabel="1"/>
|
||||
</tab>
|
||||
</tabs>
|
||||
<related>
|
||||
<field name="documents"/>
|
||||
<field name="patients" attrs='{"invisible":[["type","in",["nurse","other"]]]}'/>
|
||||
<field name="nurse_visits" attrs='{"invisible":[["type","in",["doctor","other"]]]}'/>
|
||||
<field name="doctor_visits" attrs='{"invisible":[["type","in",["nurse","other"]]]}'/>
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
<form model="clinic.personal.move">
|
||||
<field name="personal_id"/>
|
||||
<field name="level_id"/>
|
||||
<field name="from_company_id"/>
|
||||
<field name="to_company_id"/>
|
||||
<field name="hire_date"/>
|
||||
<field name="resign_date"/>
|
||||
<field name="wage"/>
|
||||
<field name="note"/>
|
||||
</form>
|
|
@ -0,0 +1,10 @@
|
|||
<list model="clinic.personal.move">
|
||||
<field name="personal_id"/>
|
||||
<field name="level_id"/>
|
||||
<field name="from_company_id"/>
|
||||
<field name="to_company_id"/>
|
||||
<field name="hire_date"/>
|
||||
<field name="resign_date"/>
|
||||
<field name="wage"/>
|
||||
<field name="note"/>
|
||||
</list>
|
|
@ -42,7 +42,8 @@ from . import translate
|
|||
from . import payment
|
||||
from . import account_payment
|
||||
from . import account_invoice
|
||||
from . import personal
|
||||
from . import personal_categ
|
||||
from . import personal_level
|
||||
from . import personal
|
||||
from . import personal_move
|
||||
from . import schedule
|
||||
|
|
|
@ -29,7 +29,7 @@ class Patient(Model):
|
|||
return res # -> {1: 30, 2: 45,.....}
|
||||
|
||||
_fields={
|
||||
"type": fields.Selection([("mg","Medical Government"),("sc","Social Security"),("nhso","NHSO (30฿)"),("personal","Personal"),("others","Others")],"Patient Type",required=True),
|
||||
"type": fields.Selection([("sc","Social Security"),("nhso","NHSO (30฿)"),("personal","Personal"),("others","Others")],"Patient Type",required=True),
|
||||
"number": fields.Char("Patient No.",required=True,search=True),
|
||||
"hn": fields.Char("REF/HN",search=True),
|
||||
"name": fields.Char("Name",required=True,search=True),
|
||||
|
@ -80,6 +80,7 @@ class Patient(Model):
|
|||
'note': fields.Text("Note"),
|
||||
'categ_id': fields.Many2One("clinic.patient.categ","Category"),
|
||||
'doctor_id': fields.Many2One("clinic.personal","Doctor",domain=[['type','=','doctor']]),
|
||||
"documents": fields.One2Many("document","related_id","Documents"),
|
||||
}
|
||||
|
||||
def _get_number(self,context={}):
|
||||
|
|
|
@ -9,7 +9,7 @@ class Personal(Model):
|
|||
_audit_log=True
|
||||
_multi_company=True
|
||||
|
||||
def _get_age(self,ids,context):
|
||||
def _get_age(self,ids,context={}):
|
||||
res={}
|
||||
year_now=int(time.strftime("%Y"))
|
||||
for obj in self.browse(ids):
|
||||
|
@ -19,21 +19,35 @@ class Personal(Model):
|
|||
age=year_now-year_bd
|
||||
res[obj.id]=age
|
||||
return res
|
||||
|
||||
def _get_level(self,ids,context={}):
|
||||
res={}
|
||||
for obj in self.browse(ids):
|
||||
level_id=None
|
||||
for move in obj.moves:
|
||||
level_id=move.level_id.id
|
||||
res[obj.id]=level_id
|
||||
return res
|
||||
|
||||
_fields={
|
||||
"number": fields.Char("Ref.",required=True,search=True),
|
||||
"name": fields.Char("Name",required=True,search=True),
|
||||
"identification" : fields.Char("Identification"),
|
||||
"expiry_card" : fields.Date("Card Expiry"),
|
||||
"name_eng": fields.Char("Eng Name",search=True),
|
||||
"nick_name": fields.Char("Nick Name",search=True),
|
||||
"identification" : fields.Char("Identification Card"),
|
||||
"expiry_card" : fields.Date("Expired Card"),
|
||||
"birthday": fields.Date("Birthday",search=True),
|
||||
"age": fields.Integer("Age", function="_get_age"),
|
||||
"state": fields.Selection([["temporary","Temporary"],["permanent","Permanent"]],"Status",search=True),
|
||||
"type": fields.Selection([["doctor","Doctor"],["nurse","Nurse"],["other","Other"]],"Type"),
|
||||
"type": fields.Selection([['personal','Personal'],["doctor","Doctor"],["nurse","Nurse"]],"Type"),
|
||||
"gender": fields.Selection([["male","Male"],["female","Female"]],"Gender"),
|
||||
"nation_id": fields.Many2One("clinic.nation","Nationality"),
|
||||
"mobile": fields.Char("Mobile",required=False,search=True),
|
||||
"phone": fields.Char("Phone",search=True),
|
||||
'email': fields.Char("Email"),
|
||||
"prof_license" : fields.Char("License."),
|
||||
"prof_license" : fields.Char("License No."),
|
||||
"prof_license_date" : fields.Date("License Date"),
|
||||
"prof_license_expiry" : fields.Date("Expired License"),
|
||||
"birthday": fields.Date("BirthDay",search=True),
|
||||
"department_id": fields.Many2One("clinic.department", "Department",search=True),
|
||||
"patients": fields.One2Many("clinic.patient","doctor_id","Patients"),
|
||||
|
@ -47,10 +61,14 @@ class Personal(Model):
|
|||
'picture': fields.File("Picture"),
|
||||
'note': fields.Text("Note"),
|
||||
'categ_id': fields.Many2One("clinic.personal.categ", "Category"),
|
||||
'level_id': fields.Many2One("clinic.personal.level", "Level"),
|
||||
'level_id': fields.Many2One("clinic.personal.level", "Personal Level", function="_get_level"),
|
||||
'active': fields.Boolean("Active"),
|
||||
'date': fields.Date("Register Date"),
|
||||
'base': fields.Float("Base Amount"),
|
||||
'hire_date': fields.Date("Hire Date"),
|
||||
'resign_date': fields.Date("Resign Date"),
|
||||
"documents": fields.One2Many("document","related_id","Documents"),
|
||||
"moves": fields.One2Many("clinic.personal.move","personal_id","Moves"),
|
||||
}
|
||||
|
||||
def _get_number(self,context={}):
|
||||
|
@ -72,7 +90,7 @@ class Personal(Model):
|
|||
_defaults={
|
||||
'active': True,
|
||||
"state": "temporary",
|
||||
'type': 'nurse',
|
||||
'type': 'personal',
|
||||
"personal_type": "temporary",
|
||||
"date": lambda *a: time.strftime("%Y-%m-%d"),
|
||||
"number": _get_number,
|
||||
|
|
|
@ -10,13 +10,13 @@ class PersonalLevel(Model):
|
|||
'formular': fields.Text("Formular"),
|
||||
'description': fields.Text("Description"),
|
||||
'sequence': fields.Integer("Sequence"),
|
||||
"type": fields.Selection([("doctor","Doctor"),("nurse","Nurse")],"Personal Type",required=True),
|
||||
"type": fields.Selection([('personal','Personal'),("doctor","Doctor"),("nurse","Nurse")],"Personal Type",required=True),
|
||||
}
|
||||
|
||||
_defaults={
|
||||
"company_id": lambda *a: get_active_company(),
|
||||
'sequence': 0,
|
||||
'type': 'nurse',
|
||||
'type': 'personal',
|
||||
'formular': '',
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,18 @@
|
|||
from netforce.model import Model, fields
|
||||
|
||||
class PersonalMove(Model):
|
||||
_name="clinic.personal.move"
|
||||
_string="Personal Move"
|
||||
|
||||
_fields={
|
||||
"personal_id": fields.Many2One("clinic.personal","Personal (Doctor/Nurse)"),
|
||||
"level_id": fields.Many2One("clinic.personal.level","Personal Level"),
|
||||
"from_company_id": fields.Many2One("company", "From"),
|
||||
"to_company_id": fields.Many2One("company", "To"),
|
||||
"hire_date": fields.Date("Hire Date"),
|
||||
"resign_date": fields.Date("Resign Date"),
|
||||
"wage": fields.Float("Wage"),
|
||||
"note": fields.Text("Note"),
|
||||
}
|
||||
|
||||
PersonalMove.register()
|
Loading…
Reference in New Issue