conv_bal
watcha.h@almacom.co.th 2015-01-15 13:44:58 +07:00
parent bf98e00c42
commit c44a5f5917
4 changed files with 14 additions and 6 deletions

View File

@ -14,11 +14,11 @@
<field name="exp_date"/>
</group>
<group span="6" columns="1">
<field name="product_id"/>
<field name="product_id" onchange="onchange_product"/>
<field name="dialyzer_type"/>
<field name="use_time"/>
<field name="max_use_time"/>
<field name="description"/>
<field name="note"/>
<field name="company_id" invisible="1"/>
</group>
<group span="6" columns="1">

View File

@ -14,7 +14,7 @@ class Dialyzer(Model):
"name": fields.Char("Name",search=True),
"number": fields.Char("Number",required=True,search=True),
'ref': fields.Char("Ref."),
"description": fields.Text("Description",search=True),
"note": fields.Text("Note",search=True),
"date": fields.Date("Create Date",search=True),
"use_time": fields.Integer("Use Time"),
"max_use_time": fields.Integer("Max Use Time"),
@ -236,6 +236,14 @@ class Dialyzer(Model):
data['department_id']=department.id
return data
def onchange_product(self,context={}):
data=context['data']
prod_id=data['product_id']
prod=get_model("product").browse(prod_id)
if prod:
data['name']=prod.name
return data
def name_get(self,ids,context={}):
vals=[]
for obj in self.browse(ids):

View File

@ -182,7 +182,7 @@ class HDCase(Model):
})
raise Exception("%s is expired"%dialyzer.number)
use_time+=1
line["description"]=dialyzer.description or dialyzer.product_id.name or ""
line["description"]=dialyzer.name or dialyzer.product_id.name or ""
line["use_time"]=use_time
line["max_use_time"]=dialyzer.max_use_time
line["dialyzer_type"]=dialyzer.dialyzer_type
@ -880,7 +880,7 @@ class HDCase(Model):
}
vals['dialyzers'].append(('create',{
'dialyzer_id': dlz_id,
'description': dialyzer.description or product_name,
'description': dialyzer.name or product_name,
'use_time': 1,
'max_use_time': dialyzer.max_use_time,
'dialyzer_type': dialyzer.dialyzer_type,

View File

@ -135,7 +135,7 @@ class Visit(Model):
dialyzer=get_model("clinic.dialyzer").browse(dlz_id)
use_time+=1
vals={
"description": dialyzer.description or dialyzer.product_id.name or "",
"description": dialyzer.name or dialyzer.product_id.name or "",
"use_time": use_time,
"max_use_time": dialyzer.max_use_time,
"dialyzer_type": dialyzer.dialyzer_type,