conv_bal
watcha.h 2014-11-02 08:26:42 +07:00
parent b91f11c93a
commit cd1df26d1e
21 changed files with 73 additions and 58 deletions

View File

@ -0,0 +1,7 @@
<action>
<field name="string">Personal Levels</field>
<field name="view_cls">multi_view</field>
<field name="model">clinic.personal.level</field>
<field name="modes">list,page,form</field>
<field name="menu">clinic_menu</field>
</action>

View File

@ -7,8 +7,8 @@
<field name="patient_categ_id" span="3"/> <field name="patient_categ_id" span="3"/>
<field name="doctor_id" span="3"/> <field name="doctor_id" span="3"/>
<field name="nurse_categ_id" span="3"/> <field name="nurse_categ_id" span="3"/>
<field name="department_id" span="3"/>
<field name="patient_type" span="3"/> <field name="patient_type" span="3"/>
<field name="department_id" span="3"/>
</group> </group>
<separator string="Select Days"/> <separator string="Select Days"/>
<group form_layout="stacked"> <group form_layout="stacked">

View File

@ -93,7 +93,10 @@
<!--<field name="total_nurse"/>--> <!--<field name="total_nurse"/>-->
</group> </group>
</tab> </tab>
<tab string="Other Info"> <tab string="Approval">
<field name="nurse_id"/>
</tab>
<tab string="Others">
<group span="6" columns="1"> <group span="6" columns="1">
<field name="fee_partner_id" domain="[['type','=','org']]"/> <field name="fee_partner_id" domain="[['type','=','org']]"/>
</group> </group>

View File

@ -5,8 +5,9 @@
<item string="Doctors" action="clinic_personal" action_options="tab_no=2"/> <item string="Doctors" action="clinic_personal" action_options="tab_no=2"/>
<item string="Nurses" action="clinic_personal" action_options="tab_no=3"/> <item string="Nurses" action="clinic_personal" action_options="tab_no=3"/>
<divider/> <divider/>
<header string="CATEGORIES"/> <header string="PERSONAL SETTINGS"/>
<item string="Personal Categories" action="clinic_personal_categ"/> <item string="Categories" action="clinic_personal_categ"/>
<item string="Levels" action="clinic_personal_level"/>
</item> </item>
<item string="Patients"> <item string="Patients">
<item string="Patients" action="clinic_patient"/> <item string="Patients" action="clinic_patient"/>

View File

@ -1,4 +1,4 @@
<form model="clinic.patient.categ"> <form model="clinic.patient.categ">
<field name="name"/> <field name="name"/>
<field name="code"/> <field name="parent_id"/>
</form> </form>

View File

@ -1,4 +1,4 @@
<list model="clinic.patient.categ"> <list model="clinic.patient.categ">
<field name="name"/> <field name="name"/>
<field name="code"/> <field name="parent_id"/>
</list> </list>

View File

@ -8,14 +8,13 @@
</button> </button>
</head> </head>
<field name="number"/> <field name="number"/>
<!--<field name="type" onchange="onchange_type"/>-->
<field name="type"/> <field name="type"/>
<field name="name"/> <field name="name"/>
<field name="hn"/> <field name="hn"/>
<field name="reg_date"/> <field name="reg_date"/>
<field name="partner_id"/> <field name="partner_id"/>
<field name="categ_id"/> <field name="categ_id"/>
<field name="active"/> <field name="doctor_id"/>
<tabs> <tabs>
<tab string="General Information"> <tab string="General Information">
<group span="6" columns="1"> <group span="6" columns="1">
@ -88,6 +87,7 @@
</tab> </tab>
<tab string="Note"> <tab string="Note">
<field name="note" nolabel="1"/> <field name="note" nolabel="1"/>
<field name="active"/>
</tab> </tab>
</tabs> </tabs>
<related> <related>

View File

@ -1,7 +1,4 @@
<form model="clinic.personal.categ"> <form model="clinic.personal.categ">
<field name="code"/>
<field name="name"/> <field name="name"/>
<field name="type"/> <field name="parent_id"/>
<field name="formular"/>
<field name="sequence"/>
</form> </form>

View File

@ -1,7 +1,4 @@
<list model="clinic.personal.categ"> <list model="clinic.personal.categ">
<field name="code"/>
<field name="name"/> <field name="name"/>
<field name="type"/> <field name="parent_id"/>
<field name="formular"/>
<field name="sequence"/>
</list> </list>

View File

@ -16,6 +16,7 @@
<field name="birthday"/> <field name="birthday"/>
<field name="department_id"/> <field name="department_id"/>
<field name="categ_id"/> <field name="categ_id"/>
<field name="level_id"/>
<field name="state"/> <field name="state"/>
</group> </group>
<group span="6" columns="1"> <group span="6" columns="1">

View File

@ -0,0 +1,7 @@
<form model="clinic.personal.level">
<field name="name"/>
<field name="type"/>
<field name="formular"/>
<field name="sequence"/>
<field name="description"/>
</form>

View File

@ -0,0 +1,6 @@
<list model="clinic.personal.level">
<field name="name"/>
<field name="type"/>
<field name="formular"/>
<field name="sequence"/>
</list>

View File

@ -48,5 +48,6 @@ from . import payment
from . import account_payment from . import account_payment
from . import account_invoice from . import account_invoice
from . import personal_categ from . import personal_categ
from . import personal_level
from . import personal from . import personal
from . import schedule from . import schedule

View File

@ -251,7 +251,7 @@ class GenVisit(Model):
'name': 'clinic_gen_visit_form', 'name': 'clinic_gen_visit_form',
'mode': 'form', 'mode': 'form',
}, },
'flash': 'Clear OK', 'flash': 'Clear %s visits'%len(vids),
} }
if days: if days:
@ -310,7 +310,7 @@ class GenVisit(Model):
'name': 'clinic_visit', 'name': 'clinic_visit',
'mode': 'list', 'mode': 'list',
}, },
'flash': 'Clear OK', 'flash': 'Clear %s visits'%len(visit_ids),
} }
GenVisit.register() GenVisit.register()

View File

@ -34,7 +34,7 @@ class HDCase(Model):
"time_stop": fields.DateTime("Time stop",required=True,search=True), "time_stop": fields.DateTime("Time stop",required=True,search=True),
"date": fields.Date("Time stop",required=True,search=True), "date": fields.Date("Time stop",required=True,search=True),
"patient_id": fields.Many2One("clinic.patient","Patient",required=True,search=True), "patient_id": fields.Many2One("clinic.patient","Patient",required=True,search=True),
"nurse_id": fields.Many2One("clinic.personal","Approve By", domain=[['type','=','nurse']],required=True), "nurse_id": fields.Many2One("clinic.personal","Approve By", domain=[['type','=','nurse']]),
"department_id": fields.Many2One("clinic.department", "Department",search=True), "department_id": fields.Many2One("clinic.department", "Department",search=True),
"wh_start": fields.Float("Wt.Kg start"), "wh_start": fields.Float("Wt.Kg start"),
"wh_stop": fields.Float("Wt.Kg stop"), "wh_stop": fields.Float("Wt.Kg stop"),

View File

@ -76,10 +76,10 @@ class Patient(Model):
"hd_cases": fields.One2Many("clinic.hd.case","patient_id","HD Cases"), "hd_cases": fields.One2Many("clinic.hd.case","patient_id","HD Cases"),
"partner_id": fields.Many2One("partner","Contact"), "partner_id": fields.Many2One("partner","Contact"),
"dialyzers": fields.One2Many("clinic.dialyzer","patient_id","Dialyzers"), "dialyzers": fields.One2Many("clinic.dialyzer","patient_id","Dialyzers"),
"active":fields.Boolean("Active"), "active":fields.Boolean("Mark as discountinue"),
'note': fields.Text("Note"), 'note': fields.Text("Note"),
'categ_id': fields.Many2One("clinic.patient.categ","Category"), 'categ_id': fields.Many2One("clinic.patient.categ","Category"),
'doctor_id': fields.Many2One("clinic.personal","Doctor",domain=[['type','=','doctor']]),
} }
def _get_number(self,context={}): def _get_number(self,context={}):

View File

@ -6,7 +6,7 @@ class PatientCateg(Model):
_fields={ _fields={
"name": fields.Char("Name",required=True,search=True), "name": fields.Char("Name",required=True,search=True),
"code": fields.Char("Code",search=True), "parent_id": fields.Many2One('clinic.patient.categ',"Parent"),
} }
PatientCateg.register() PatientCateg.register()

View File

@ -46,6 +46,7 @@ class Personal(Model):
'picture': fields.File("Picture"), 'picture': fields.File("Picture"),
'note': fields.Text("Note"), 'note': fields.Text("Note"),
'categ_id': fields.Many2One("clinic.personal.categ", "Category"), 'categ_id': fields.Many2One("clinic.personal.categ", "Category"),
'level_id': fields.Many2One("clinic.personal.level", "Level"),
'active': fields.Boolean("Active"), 'active': fields.Boolean("Active"),
'date': fields.Date("Register Date"), 'date': fields.Date("Register Date"),
} }

View File

@ -1,44 +1,12 @@
from netforce.model import Model, fields from netforce.model import Model, fields
from netforce.access import get_active_company
class PersonalCateg(Model): class PersonalCategory(Model):
_name="clinic.personal.categ" _name="clinic.personal.categ"
_string="Personal Category" _string="Personal Category"
_fields={ _fields={
"name": fields.Char("Name",required=True,search=True), "name": fields.Char("Name",required=True,search=True),
"code": fields.Char("Code",required=True,search=True), 'parent_id': fields.Many2One("clinic.personal.categ","Parent"),
'formular': fields.Text("Formular"),
'sequence': fields.Integer("Sequence"),
"type": fields.Selection([("doctor","Doctor"),("nurse","Nurse")],"Personal Type",required=True),
} }
_defaults={ PersonalCategory.register()
"company_id": lambda *a: get_active_company(),
'sequence': 0,
'type': 'doctor',
'formular': '',
}
_order="sequence"
def name_get(self,ids,context={}):
vals=[]
for obj in self.browse(ids):
name="%s [%s]"%(obj.name,obj.code or "")
vals.append((obj.id,name))
return vals
def name_search(self,name,domain=None,context={},**kw):
dom=[["name","ilike","%"+name+"%"]]
if domain:
dom=[dom,domain]
ids1=self.search(dom)
dom=[["code","ilike","%"+name+"%"]]
if domain:
dom=[dom,domain]
ids2=self.search(dom)
ids=list(set(ids1+ids2))
return self.name_get(ids,context=context)
PersonalCateg.register()

View File

@ -0,0 +1,25 @@
from netforce.model import Model, fields
from netforce.access import get_active_company
class PersonalLevel(Model):
_name="clinic.personal.level"
_string="Personal Level"
_fields={
"name": fields.Char("Name",required=True,search=True),
'formular': fields.Text("Formular"),
'description': fields.Text("Description"),
'sequence': fields.Integer("Sequence"),
"type": fields.Selection([("doctor","Doctor"),("nurse","Nurse")],"Personal Type",required=True),
}
_defaults={
"company_id": lambda *a: get_active_company(),
'sequence': 0,
'type': 'nurse',
'formular': '',
}
_order="sequence"
PersonalLevel.register()

View File

@ -288,6 +288,7 @@ class Visit(Model):
def create(self, vals,**kw): def create(self, vals,**kw):
date=vals['time_start'][0:10] date=vals['time_start'][0:10]
cycle_id=vals['cycle_id'] cycle_id=vals['cycle_id']
cycle=get_model("clinic.cycle").browse(cycle_id)
dom=[] dom=[]
dom.append(['date','=',date]) dom.append(['date','=',date])
dom.append(['cycle_id','=',cycle_id]) dom.append(['cycle_id','=',cycle_id])
@ -302,7 +303,7 @@ class Visit(Model):
else: else:
item_id=item_ids[0] item_id=item_ids[0]
vals['cycle_item_id']=item_id vals['cycle_item_id']=item_id
vals['sequence']='%s-%s'%(vals['time_start'][0:10],cycle_id) vals['sequence']='%s-%s'%(vals['time_start'][0:10],cycle.sequence) #date-sequence
obj_id=super().create(vals,**kw) obj_id=super().create(vals,**kw)
return obj_id return obj_id