catch case if no binary is given (#112)

This commit is contained in:
rami-wafaie 2017-01-11 18:48:00 +01:00 committed by Holger Brunn
parent f27a5befe2
commit 594f0dd265

View File

@ -61,6 +61,9 @@ class IrAttachment(Model):
ids_to_browse = [_id for _id in ids_to_browse if _id not in result]
for this in self.pool[model].browse(cr, uid, ids_to_browse,
context=context):
if this[binary_field] is None:
result[this.id] = False
continue
try:
import magic
ms = magic.open(