catch case if no binary is given

This commit is contained in:
ralwafaie 2016-11-17 14:48:01 +01:00
parent 68ce23b74d
commit ba31233fb0

View File

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