[FIX]: Document : When creating an attachment with extension .pdf file, a copy is...
authorRavi Gohil (Open ERP) <rgo@tinyerp.com>
Mon, 6 Feb 2012 07:14:36 +0000 (12:44 +0530)
committerRavi Gohil (Open ERP) <rgo@tinyerp.com>
Mon, 6 Feb 2012 07:14:36 +0000 (12:44 +0530)
bzr revid: rgo@tinyerp.com-20120206071436-9gnmj28h2m22c9d4

addons/document/content_index.py

index 6540b87..b6f7205 100644 (file)
@@ -56,6 +56,7 @@ def content_index(content, filename=None, content_type=None):
         fp = os.popen('pdftotext -enc UTF-8 -nopgbrk '+file_name+' -', 'r')
         result = fp.read()
         fp.close()
+        os.unlink(file_name)
     elif ext in ('.xls','.ods','.odt','.odp'):
         s = StringIO.StringIO(content)
         o = odt2txt.OpenDocumentTextFile(s)