*bugfixed the case where the server is run from another place than root_path

bzr revid: qdp@tinyerp.com-20081021124038-anrrckl5c16a2c84
This commit is contained in:
qdp
2008-10-21 14:40:38 +02:00
parent 955bdee86b
commit d8b892cd7f
@@ -164,7 +164,6 @@ class accounting_report_indicator(report_sxw.rml_parse):
def test1(self,data,object,intercall=False):
obj_history=self.pool.get('account.report.history')
if data['select_base']=='year':
@@ -233,13 +232,13 @@ class accounting_report_indicator(report_sxw.rml_parse):
# drawing.save(formats=['png'],fnRoot=path+str(self.count),title="helo")
# renderPM.drawToFile(drawing1, 'example1.jpg','jpg')
import os
dirname ='Temp_images'
path=os.path.join(tools.config['root_path'],dirname,"Image")
path=tools.config['addons_path']+"/account_report/tmp_images/image"
if not os.path.isdir(tools.config['root_path']+ "/"+dirname + '/'):
os.mkdir(tools.config['root_path'] +"/"+ dirname + '/')
os.path.join(tools.config['root_path'],dirname,"/")
can = canvas.init('Image'+str(self.count)+".png")
dirname =tools.config['addons_path']+'/account_report/tmp_images/'
if not os.path.isdir(dirname):
os.mkdir(dirname)
can = canvas.init('image'+str(self.count)+".png")
# can.clip(0,0,600,400)
data=zip(self.header_name,self.header_val)
@@ -252,8 +251,8 @@ class accounting_report_indicator(report_sxw.rml_parse):
ar.draw()
can.close()
os.system('cp '+'Image'+str(self.count)+'.png ' +path+str(self.count)+'.png')
os.system('rm '+'Image'+str(self.count)+'.png')
os.system('cp '+'image'+str(self.count)+'.png ' +path+str(self.count)+'.png')
os.system('rm '+'image'+str(self.count)+'.png')
# can.endclip()
return path+str(self.count)+'.png'