improve
parent
f8d0f01cdc
commit
c48ad556bc
|
@ -76,7 +76,7 @@
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<p></p>
|
<p></p>
|
||||||
<b>Note: </b><span style="color:green"><b>"Cycle"</b> ที่ระบุไว้ที่หน้านี้ จะเป็นข้อมูลต้นทางที่ระบบจะนำไปสร้าง Visit ล่วงหน้า</span></div>
|
<b>Note: </b><span style="color:green"><b style="color:#3477b0">"Cycle"</b> ที่ระบุไว้ที่หน้านี้ จะเป็นข้อมูลต้นทางที่ระบบจะนำไปสร้าง Visit ล่วงหน้า</span></div>
|
||||||
</template>
|
</template>
|
||||||
</group>
|
</group>
|
||||||
<group span="4" columns="1">
|
<group span="4" columns="1">
|
||||||
|
@ -88,7 +88,7 @@
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<p></p>
|
<p></p>
|
||||||
<b>Note: </b><span style="color:green"><b>"Location"</b> คือ สถานที่ที่ผู้ป่วยสามารถรับการรักษา ซึ่งระบุได้มากกว่า 1 ที่</span></div>
|
<b>Note: </b><span style="color:green"><b style="color:#3477b0">"Location"</b> คือ สถานที่ที่ผู้ป่วยสามารถรับการรักษา ซึ่งระบุได้มากกว่า 1 ที่</span></div>
|
||||||
</template>
|
</template>
|
||||||
</group>
|
</group>
|
||||||
<group span="4" columns="1">
|
<group span="4" columns="1">
|
||||||
|
|
|
@ -49,7 +49,7 @@ class CycleItem(Model):
|
||||||
"state": fields.Selection([("draft","Draft"),("validated","Validated")],"Status",required=True),
|
"state": fields.Selection([("draft","Draft"),("validated","Validated")],"Status",required=True),
|
||||||
'nurse_total': fields.Integer("Nurses",function="_get_all",function_multi=True),
|
'nurse_total': fields.Integer("Nurses",function="_get_all",function_multi=True),
|
||||||
}
|
}
|
||||||
|
|
||||||
def _get_branch(self,context={}):
|
def _get_branch(self,context={}):
|
||||||
res=get_model('select.company').get_select()
|
res=get_model('select.company').get_select()
|
||||||
if res:
|
if res:
|
||||||
|
@ -58,8 +58,10 @@ class CycleItem(Model):
|
||||||
def _get_department(self,context={}):
|
def _get_department(self,context={}):
|
||||||
res=get_model('select.company').get_select()
|
res=get_model('select.company').get_select()
|
||||||
if res:
|
if res:
|
||||||
return res['department_id']
|
if res.get("department_ids"):
|
||||||
|
return res['department_ids'][0]
|
||||||
|
else:
|
||||||
|
return res['department_id']
|
||||||
|
|
||||||
_defaults={
|
_defaults={
|
||||||
'state': 'draft',
|
'state': 'draft',
|
||||||
|
|
|
@ -55,15 +55,6 @@ class Shop(Model):
|
||||||
'note': fields.Text("Note"),
|
'note': fields.Text("Note"),
|
||||||
}
|
}
|
||||||
|
|
||||||
def _get_branch(self,context={}):
|
|
||||||
b_ids=get_model('clinic.branch').search([])
|
|
||||||
if b_ids:
|
|
||||||
return b_ids[0]
|
|
||||||
|
|
||||||
def _get_department(self,context={}):
|
|
||||||
dpt_ids=get_model('clinic.department').search([])
|
|
||||||
if dpt_ids:
|
|
||||||
return dpt_ids[0]
|
|
||||||
|
|
||||||
def _get_shop_categs(self,context={}):
|
def _get_shop_categs(self,context={}):
|
||||||
st=get_model("clinic.setting").browse(1)
|
st=get_model("clinic.setting").browse(1)
|
||||||
|
@ -114,6 +105,19 @@ class Shop(Model):
|
||||||
return num
|
return num
|
||||||
get_model("sequence").increment_number(seq_id,context=context)
|
get_model("sequence").increment_number(seq_id,context=context)
|
||||||
|
|
||||||
|
def _get_branch(self,context={}):
|
||||||
|
res=get_model('select.company').get_select()
|
||||||
|
if res:
|
||||||
|
return res['branch_id']
|
||||||
|
|
||||||
|
def _get_department(self,context={}):
|
||||||
|
res=get_model('select.company').get_select()
|
||||||
|
if res:
|
||||||
|
if res.get("department_ids"):
|
||||||
|
return res['department_ids'][0]
|
||||||
|
else:
|
||||||
|
return res['department_id']
|
||||||
|
|
||||||
_defaults={
|
_defaults={
|
||||||
'number': '/',
|
'number': '/',
|
||||||
'date': lambda *a: time.strftime("%Y-%m-%d"),
|
'date': lambda *a: time.strftime("%Y-%m-%d"),
|
||||||
|
@ -183,9 +187,8 @@ class Shop(Model):
|
||||||
data=context['data']
|
data=context['data']
|
||||||
contact_id=data['contact_id']
|
contact_id=data['contact_id']
|
||||||
data['patient_id']=None
|
data['patient_id']=None
|
||||||
data['department_id']=None
|
#data['department_id']=None
|
||||||
data['branch_id']=None
|
#data['branch_id']=None
|
||||||
print("contact_id ", contact_id)
|
|
||||||
for patient in get_model("clinic.patient").search_browse([['partner_id','=',contact_id]]):
|
for patient in get_model("clinic.patient").search_browse([['partner_id','=',contact_id]]):
|
||||||
dpt=patient.department_id
|
dpt=patient.department_id
|
||||||
branch=patient.branch_id
|
branch=patient.branch_id
|
||||||
|
|
Loading…
Reference in New Issue