[FIX] ir_attachment preview method corrected

bzr revid: jvo@tinyerp.com-20090617085552-fvr110ncmhey174k
This commit is contained in:
Jay (Open ERP)
2009-06-17 14:25:52 +05:30
parent 1e37afb52f
commit 25820318cb
+1 -1
View File
@@ -95,7 +95,7 @@ class ir_attachment(osv.osv):
for i in self.browse(cr, uid, ids, context=context):
result[i.id] = False
for format in ('png','jpg','jpeg','gif','bmp'):
if (i.datas_fname.lower() or '').endswith(format):
if (i.datas_fname and i.datas_fname.lower() or '').endswith(format):
result[i.id]= i.datas
break
return result