summaryrefslogtreecommitdiff
path: root/addons/document/document.py
diff options
context:
space:
mode:
authorhmo-tinyerp <>2008-12-16 18:05:15 +0530
committerhmo-tinyerp <>2008-12-16 18:05:15 +0530
commit4566b4174e02e4a980f23f95cf074b354aa6299f (patch)
tree616935b882381a453a3e51473ab1e6e4a07fcb3b /addons/document/document.py
parent16b95805c4898c9ee2db059cd0f8c5d57ac141b2 (diff)
fixed bug : unicode problem on display path
bzr revid: hmo-tinyerp-20081216123515-qh0zve76cto3mqsy
Diffstat (limited to 'addons/document/document.py')
-rw-r--r--addons/document/document.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/addons/document/document.py b/addons/document/document.py
index afb466c983a..eb5affaa853 100644
--- a/addons/document/document.py
+++ b/addons/document/document.py
@@ -37,6 +37,7 @@ import random
import string
from psycopg2 import Binary
from tools import config
+import tools
def random_name():
random.seed()
@@ -497,6 +498,9 @@ class document_file(osv.osv):
result[id]=''
else:
result[id] = ''
+ if context.get('bin_size', False):
+ result[id] = tools.human_size(len(result[id]))
+
return result
#
@@ -539,7 +543,7 @@ class document_file(osv.osv):
'create_date': fields.datetime('Date Created', readonly=True),
'create_uid': fields.many2one('res.users', 'Creator', readonly=True),
'store_method': fields.selection([('db','Database'),('fs','Filesystem'),('link','Link')], "Storing Method"),
- 'datas': fields.function(_data_get,method=True,store=True,fnct_inv=_data_set,string='File Content',type="binary"),
+ 'datas': fields.function(_data_get,method=True,fnct_inv=_data_set,string='File Content',type="binary"),
'store_fname': fields.char('Stored Filename', size=200),
'res_model': fields.char('Attached Model', size=64), #res_model
'res_id': fields.integer('Attached ID'), #res_id