From d8b892cd7f919ee7ca58f2325a46806a74a284bf Mon Sep 17 00:00:00 2001 From: qdp Date: Tue, 21 Oct 2008 14:40:38 +0200 Subject: [PATCH] *bugfixed the case where the server is run from another place than root_path bzr revid: qdp@tinyerp.com-20081021124038-anrrckl5c16a2c84 --- addons/account_report/report/print_indicator.py | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/addons/account_report/report/print_indicator.py b/addons/account_report/report/print_indicator.py index 2fc73c68649..203f249178b 100644 --- a/addons/account_report/report/print_indicator.py +++ b/addons/account_report/report/print_indicator.py @@ -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'