mirror of
https://gitlab.com/hibou-io/hibou-odoo/suite.git
synced 2025-01-20 12:37:31 +02:00
[MIG] attachment_minio: for Odoo 14.0
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "Attachment MinIO",
|
||||
"version": "13.0.1.0.0",
|
||||
"version": "14.0.1.0.0",
|
||||
"depends": [
|
||||
"base_attachment_object_storage",
|
||||
],
|
||||
|
||||
@@ -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 ''
|
||||
|
||||
Reference in New Issue
Block a user