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">[
["All",[["state","=","admit"]]],
["Archived",[["active","=","False"]]],
["Walkin",[["walkin","=","yes"]]],
["Disposed",[["state","=","dispose"]]]]
</field>
<field name="menu">clinic_menu</field>

View File

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

View File

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

View File

@ -9,13 +9,12 @@
</head>
<field name="number"/>
<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="title_id" required="1"/>
<field name="reg_date"/>
<field name="first_name" required="1"/>
<field name="last_name" required="1"/>
<!--<field name="categ_id"/>-->
<field name="doctor_id"/>
<field name="walkin"/>
<field name="department_id" invisible="1"/>

View File

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

View File

@ -3,9 +3,11 @@ from netforce.model import Model, fields
class Nation(Model):
_name="clinic.nation"
_string="Nationality"
_key=['code']
_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()

View File

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