From a717f9c4bf495b510e4ed103f7e42af1328cf029 Mon Sep 17 00:00:00 2001 From: Jared Kipe Date: Sun, 21 Mar 2021 13:19:30 -0700 Subject: [PATCH] [MIG] attachment_minio: for Odoo 14.0 --- attachment_minio/__manifest__.py | 2 +- .../migrations/{13.0.0.0.1 => 14.0.0.0.1}/post-migration.py | 0 attachment_minio/models/ir_attachment.py | 3 +-- 3 files changed, 2 insertions(+), 3 deletions(-) rename attachment_minio/migrations/{13.0.0.0.1 => 14.0.0.0.1}/post-migration.py (100%) diff --git a/attachment_minio/__manifest__.py b/attachment_minio/__manifest__.py index fe230ae8..495041dc 100755 --- a/attachment_minio/__manifest__.py +++ b/attachment_minio/__manifest__.py @@ -1,6 +1,6 @@ { "name": "Attachment MinIO", - "version": "13.0.1.0.0", + "version": "14.0.1.0.0", "depends": [ "base_attachment_object_storage", ], diff --git a/attachment_minio/migrations/13.0.0.0.1/post-migration.py b/attachment_minio/migrations/14.0.0.0.1/post-migration.py similarity index 100% rename from attachment_minio/migrations/13.0.0.0.1/post-migration.py rename to attachment_minio/migrations/14.0.0.0.1/post-migration.py diff --git a/attachment_minio/models/ir_attachment.py b/attachment_minio/models/ir_attachment.py index 70ba2640..2d963f8f 100644 --- a/attachment_minio/models/ir_attachment.py +++ b/attachment_minio/models/ir_attachment.py @@ -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 ''