From 0f03dad429b026da8914eebbe89b33e90f6e5cf2 Mon Sep 17 00:00:00 2001 From: Mathias Markl Date: Fri, 12 Jan 2018 23:33:23 +0100 Subject: [PATCH] u --- muk_fields_lobject/fields.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/muk_fields_lobject/fields.py b/muk_fields_lobject/fields.py index 68a2117..a52cc9f 100644 --- a/muk_fields_lobject/fields.py +++ b/muk_fields_lobject/fields.py @@ -57,8 +57,10 @@ class LargeObject(fields.Field): def convert_to_record(self, value, record): if value: lobject = record.env.cr._cnx.lobject(value, 'rb') - if record._context.get('bin_size') or record._context.get('bin_size_' + self.name): + if record._context.get('human_size'): return human_size(lobject.seek(0, 2)) + elif record._context.get('bin_size'): + return lobject.seek(0, 2) elif record._context.get('oid'): return lobject.oid elif record._context.get('stream'):