mirror of
https://github.com/OCA/knowledge.git
synced 2025-07-24 17:38:42 -06:00
catch case if no binary is given (#112)
This commit is contained in:
parent
f27a5befe2
commit
594f0dd265
@ -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(
|
||||||
|
Loading…
Reference in New Issue
Block a user