diff options
| author | Fabien Pinckaers <fp@tinyerp.com> | 2009-03-31 01:10:59 +0200 |
|---|---|---|
| committer | Fabien Pinckaers <fp@tinyerp.com> | 2009-03-31 01:10:59 +0200 |
| commit | 0f89e23954fe0597e8e745bea2f6818d186737c8 (patch) | |
| tree | 69e7095b6d1c9fbd735cbb110cf38e3f393bd43a /addons/document/document.py | |
| parent | 5d0e6c409bf692ffc586a9d6d943647b0a912997 (diff) | |
merge
bzr revid: fp@tinyerp.com-20090330231059-axmtdiszz5kpbfpe
Diffstat (limited to 'addons/document/document.py')
| -rw-r--r-- | addons/document/document.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/addons/document/document.py b/addons/document/document.py index e86d90e4643..fcd60619a97 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): |
