diff --git a/openerp/addons/base/ir/ir_attachment.py b/openerp/addons/base/ir/ir_attachment.py index 82ec746ec6b..a4927931d08 100644 --- a/openerp/addons/base/ir/ir_attachment.py +++ b/openerp/addons/base/ir/ir_attachment.py @@ -162,9 +162,6 @@ class ir_attachment(osv.osv): result[attach.id] = self._file_read(cr, uid, attach.store_fname, bin_size) else: result[attach.id] = attach.db_datas - if bin_size: - result[attach.id] = int(result[attach.id] or 0) - return result def _data_set(self, cr, uid, id, name, value, arg, context=None): diff --git a/openerp/osv/fields.py b/openerp/osv/fields.py index b2f71142638..5ef82ed2683 100644 --- a/openerp/osv/fields.py +++ b/openerp/osv/fields.py @@ -1069,6 +1069,8 @@ def get_nice_size(value): size = value elif value: # this is supposed to be a string size = len(value) + if size < 12: # suppose human size + return value return tools.human_size(size) # See http://www.w3.org/TR/2000/REC-xml-20001006#NT-Char