Skip to content
This repository
Browse code

fixed error in the quote pdf creation

  • Loading branch information...
commit beadf0472b0c6374b37a6ea2309230b14fc73645 1 parent 5737144
Aaron Riedener authored April 24, 2012

Showing 1 changed file with 10 additions and 6 deletions. Show diff stats Hide diff stats

  1. 16  crm/models.py
16  crm/models.py
@@ -432,14 +432,18 @@ def createPDF(self, purchaseconfirmation):
432 432
      projectroot = etree.SubElement(rootelement, "projectroot")
433 433
      projectroot.text = settings.PROJECT_ROOT
434 434
      xml.write(settings.PDF_OUTPUT_ROOT+"quote_"+str(self.id)+".xml")
435  
-     log = open(settings.PDF_OUTPUT_ROOT+"log.txt", "w")
436  
-     log.write('bash -c "fop -c '+userExtension[0].defaultTemplateSet.fopConfigurationFile.path+' -xml '+settings.PDF_OUTPUT_ROOT+'quote_'+str(self.id)+'.xml -xsl ' + userExtension[0].defaultTemplateSet.quoteXSLFile.xslfile.path+' -pdf '+settings.PDF_OUTPUT_ROOT+'quote_'+str(self.id)+'.pdf"')
437  
-     log.close()
438  
-     if (purchaseconfirmation == False) :
  435
+     if (purchaseconfirmation == False):
  436
+        log = open(settings.PDF_OUTPUT_ROOT+"log.txt", "w")
  437
+        log.write('bash -c "fop -c '+userExtension[0].defaultTemplateSet.fopConfigurationFile.path+' -xml '+settings.PDF_OUTPUT_ROOT+'quote_'+str(self.id)+'.xml -xsl ' + userExtension[0].defaultTemplateSet.quoteXSLFile.xslfile.path+' -pdf '+settings.PDF_OUTPUT_ROOT+'quote_'+str(self.id)+'.pdf"')
  438
+        log.close()
439 439
         system('bash -c "fop -c '+userExtension[0].defaultTemplateSet.fopConfigurationFile.path+' -xml '+settings.PDF_OUTPUT_ROOT+'quote_'+str(self.id)+'.xml -xsl ' + userExtension[0].defaultTemplateSet.quoteXSLFile.xslfile.path+' -pdf '+settings.PDF_OUTPUT_ROOT+'quote_'+str(self.id)+'.pdf"')
  440
+        return settings.PDF_OUTPUT_ROOT+"quote_"+str(self.id)+".pdf"
440 441
      else:
441  
-        system('bash -c "fop -c '+userExtension[0].defaultTemplateSet.fopConfigurationFile.path+'  -xml '+settings.PDF_OUTPUT_ROOT+'quote_'+str(self.id)+'.xml -xsl ' + userExtension[0].defaultTemplateSet.purchaseconfirmationXSLFile.xslfile.path+' -pdf '+settings.PDF_OUTPUT_ROOT+'purchaseconfirmation_'+str(self.id)+'.pdf"')
442  
-     return settings.PDF_OUTPUT_ROOT+"quote_"+str(self.id)+".pdf"
  442
+        log = open(settings.PDF_OUTPUT_ROOT+"log.txt", "w")
  443
+        log.write('bash -c "fop -c '+userExtension[0].defaultTemplateSet.fopConfigurationFile.path+' -xml '+settings.PDF_OUTPUT_ROOT+'quote_'+str(self.id)+'.xml -xsl ' + userExtension[0].defaultTemplateSet.purchaseconfirmationXSLFile.xslfile.path+' -pdf '+settings.PDF_OUTPUT_ROOT+'purchaseconfirmation_'+str(self.id)+'.pdf"')
  444
+        log.close()
  445
+        system('bash -c "fop -c '+userExtension[0].defaultTemplateSet.fopConfigurationFile.path+' -xml '+settings.PDF_OUTPUT_ROOT+'quote_'+str(self.id)+'.xml -xsl ' + userExtension[0].defaultTemplateSet.purchaseconfirmationXSLFile.xslfile.path+' -pdf '+settings.PDF_OUTPUT_ROOT+'purchaseconfirmation_'+str(self.id)+'.pdf"')
  446
+        return settings.PDF_OUTPUT_ROOT+"purchaseconfirmation_"+str(self.id)+".pdf"  
443 447
      
444 448
    def __unicode__(self):
445 449
       return _("Quote")+ ": " + str(self.id) + " "+_("from Contract")+": " + str(self.contract.id) 

0 notes on commit beadf04

Please sign in to comment.
Something went wrong with that request. Please try again.