[MIG] attachment_minio: for Odoo 14.0

This commit is contained in:
Jared Kipe
2021-03-21 13:19:30 -07:00
parent c7d5170f41
commit a717f9c4bf
3 changed files with 2 additions and 3 deletions

View File

@@ -3,7 +3,6 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html)
import io
import base64
import logging
from minio import Minio
from minio.error import NoSuchKey
@@ -73,7 +72,7 @@ class MinioAttachment(models.Model):
bucket = self._get_minio_bucket(client, name=s3uri.bucket())
try:
response = client.get_object(bucket, s3uri.item())
return base64.b64encode(response.read())
return response.read()
except NoSuchKey:
_logger.info('attachment "%s" missing from remote object storage', (fname, ))
return ''