summaryrefslogtreecommitdiff
path: root/addons/document/document.py
diff options
context:
space:
mode:
Diffstat (limited to 'addons/document/document.py')
-rw-r--r--addons/document/document.py14
1 files changed, 8 insertions, 6 deletions
diff --git a/addons/document/document.py b/addons/document/document.py
index e86d90e4643..31ab13ae4df 100644
--- a/addons/document/document.py
+++ b/addons/document/document.py
@@ -492,11 +492,11 @@ class document_file(osv.osv):
result = {}
cr.execute('select id,store_fname,link from ir_attachment where id in ('+','.join(map(str,ids))+')')
for id,r,l in cr.fetchall():
- try:
- value = file(os.path.join(self._get_filestore(cr), r), 'rb').read()
- result[id] = base64.encodestring(value)
- except:
- result[id]=''
+ try:
+ value = file(os.path.join(self._get_filestore(cr), r), 'rb').read()
+ result[id] = base64.encodestring(value)
+ except:
+ result[id]=''
if context.get('bin_size', False):
result[id] = tools.human_size(len(result[id]))
@@ -581,7 +581,7 @@ class document_file(osv.osv):
res_id=file.res_id and file.res_id or 0
res=self.search(cr,uid,[('id','<>',file.id),('name','=',name),('parent_id','=',parent_id),('res_model','=',res_model),('res_id','=',res_id)])
if len(res):
- return False
+ return False
if op=='create':
res=self.search(cr,uid,[('name','=',name),('parent_id','=',parent_id),('res_id','=',res_id),('res_model','=',res_model)])
if len(res):
@@ -771,3 +771,5 @@ class document_configuration_wizard(osv.osv_memory):
'target':'new',
}
document_configuration_wizard()
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: