conv_bal
watcha.h 2015-03-17 08:49:03 +07:00
parent 378914c021
commit 66a9cf0cea
7 changed files with 13 additions and 8 deletions

View File

@ -5,6 +5,7 @@
<field name="tabs">[ <field name="tabs">[
["All",[["state","=","admit"]]], ["All",[["state","=","admit"]]],
["Archived",[["active","=","False"]]], ["Archived",[["active","=","False"]]],
["Walkin",[["walkin","=","yes"]]],
["Disposed",[["state","=","dispose"]]]] ["Disposed",[["state","=","dispose"]]]]
</field> </field>
<field name="menu">clinic_menu</field> <field name="menu">clinic_menu</field>

View File

@ -1,3 +1,4 @@
<form model="clinic.nation"> <form model="clinic.nation">
<field name="name"/> <field name="name"/>
<field name="code"/>
</form> </form>

View File

@ -1,3 +1,4 @@
<list model="clinic.nation"> <list model="clinic.nation">
<field name="name"/> <field name="name"/>
<field name="code"/>
</list> </list>

View File

@ -9,13 +9,12 @@
</head> </head>
<field name="number"/> <field name="number"/>
<field name="trt_no"/> <field name="trt_no"/>
<field name="card_no" required="1"/> <field name="card_no" attrs='{"required":[["card_type","=","identification"]]}'/>
<field name="type_id"/> <field name="type_id"/>
<field name="title_id" required="1"/> <field name="title_id" required="1"/>
<field name="reg_date"/> <field name="reg_date"/>
<field name="first_name" required="1"/> <field name="first_name" required="1"/>
<field name="last_name" required="1"/> <field name="last_name" required="1"/>
<!--<field name="categ_id"/>-->
<field name="doctor_id"/> <field name="doctor_id"/>
<field name="walkin"/> <field name="walkin"/>
<field name="department_id" invisible="1"/> <field name="department_id" invisible="1"/>

View File

@ -10,7 +10,7 @@
<field name="card_no"/> <field name="card_no"/>
<field name="name"/> <field name="name"/>
<field name="type_id"/> <field name="type_id"/>
<!--<field name="branch_id"/>--> <field name="walkin"/>
<field name="department_names"/> <field name="department_names"/>
<field name="doctor_id"/> <field name="doctor_id"/>
<!--<field name="image" preview='1'/>--> <!--<field name="image" preview='1'/>-->

View File

@ -3,9 +3,11 @@ from netforce.model import Model, fields
class Nation(Model): class Nation(Model):
_name="clinic.nation" _name="clinic.nation"
_string="Nationality" _string="Nationality"
_key=['code']
_fields={ _fields={
"name": fields.Char("Name",required=True,search=True), "code": fields.Char("Name",required=True,search=True),
"name": fields.Char("Code",search=True),
} }
Nation.register() Nation.register()

View File

@ -246,8 +246,10 @@ class Patient(Model):
_sql_constraints=("clinic_patient_key_uniq","unique(name_check,branch_id)","name should be unique"), _sql_constraints=("clinic_patient_key_uniq","unique(name_check,branch_id)","name should be unique"),
_order="reg_date desc" _order="reg_date desc"
def check_idcard(self,idcard=''): def check_idcard(self,card_type,idcard=''):
res=True res=True
if card_type!='identification':
return False
if idcard=='/': if idcard=='/':
return True return True
if idcard.isalpha(): if idcard.isalpha():
@ -259,7 +261,7 @@ class Patient(Model):
def create(self, vals,**kw): def create(self, vals,**kw):
if 'card_no' in vals.keys(): if 'card_no' in vals.keys():
self.check_idcard(vals['card_no']) self.check_idcard(vals.get("card_type",""),vals['card_no'])
obj_id=super().create(vals,**kw) obj_id=super().create(vals,**kw)
self.function_store([obj_id]) self.function_store([obj_id])
obj=self.browse(obj_id) obj=self.browse(obj_id)
@ -325,7 +327,7 @@ class Patient(Model):
vals['state']='admit' vals['state']='admit'
vals['rm_remain_visit']=False vals['rm_remain_visit']=False
if 'card_no' in vals.keys(): if 'card_no' in vals.keys():
self.check_idcard(vals['card_no']) self.check_idcard(vals.get("card_type",""),vals['card_no'])
ctx={} ctx={}
if 'active' in vals.keys(): if 'active' in vals.keys():
if not vals['active']: if not vals['active']:
@ -492,5 +494,4 @@ class Patient(Model):
def onchange_state(self,ids,context={}): def onchange_state(self,ids,context={}):
pass pass
Patient.register() Patient.register()