get_binary_size set as True by default

bzr revid: christophe@tinyerp.com-20080917122211-34u4ykx806nrh0xo
This commit is contained in:
Christophe Simonis 2008-09-17 14:22:11 +02:00
parent fca6850f17
commit 99911f3550
2 changed files with 3 additions and 3 deletions

View File

@ -223,7 +223,7 @@ class binary(_column):
val = v[name]
break
res.setdefault(i, val)
if context.get('get_binary_size',False):
if context.get('get_binary_size', True):
res[i] = tools.human_size(val)
return res
@ -620,7 +620,7 @@ class function(_column):
else:
res = self._fnct(cr, obj._table, ids, name, self._arg, context)
if self._type == 'binary' and context.get('get_binary_size', False):
if self._type == 'binary' and context.get('get_binary_size', True):
# convert the data returned by the function with the size of that data...
res = dict(map(lambda (x, y): (x, tools.human_size(len(y))), res.items()))
return res

View File

@ -1125,7 +1125,7 @@ class orm_memory(orm_template):
for f in fields_to_read:
if id in self.datas:
r[f] = self.datas[id].get(f, False)
if r[f] and isinstance(self._columns[f], fields.binary) and context.get('get_binary_size', False):
if r[f] and isinstance(self._columns[f], fields.binary) and context.get('get_binary_size', True):
r[f] = len(r[f])
result.append(r)
if id in self.datas: