[FIX] attachment_preview: fix get_binary_extension

This commit is contained in:
Alessio Renda
2024-02-14 10:30:45 +01:00
parent 89fb9a0417
commit 942f04b824
2 changed files with 10 additions and 0 deletions

View File

@@ -41,6 +41,8 @@ class IrAttachment(models.Model):
ids_to_browse = [_id for _id in ids_to_browse if _id not in result]
for this in self.env[model].with_context(bin_size=True).browse(ids_to_browse):
result[this.id] = False
if not this[binary_field]:
continue
try:
import magic