From 45faa3a9414631f73764a2e6fbf3b7ecb93c8a7e Mon Sep 17 00:00:00 2001 From: Nicolas Lempereur Date: Wed, 1 Jul 2015 10:04:47 +0200 Subject: [PATCH] [FIX] base: fixing fix, attachment file size and None In commit 44f2c8d54 we unified the return value of the function to int, but it seems the returned size could be None which is not a valid input of the int() built-in function. --- openerp/addons/base/ir/ir_attachment.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openerp/addons/base/ir/ir_attachment.py b/openerp/addons/base/ir/ir_attachment.py index 97edffd6ada..ad257b418c3 100644 --- a/openerp/addons/base/ir/ir_attachment.py +++ b/openerp/addons/base/ir/ir_attachment.py @@ -133,7 +133,7 @@ class ir_attachment(osv.osv): else: result[attach.id] = attach.db_datas if bin_size: - result[attach.id] = int(result[attach.id]) + result[attach.id] = int(result[attach.id] or 0) return result