mirror of
https://github.com/camptocamp/odoo-cloud-platform.git
synced 2026-06-24 02:08:36 +00:00
[13.0][FIX] attachment_azure: in 13.0, _file_read() is expected to return base64 encoded data
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
# Copyright 2016-2021 Camptocamp SA
|
# Copyright 2016-2021 Camptocamp SA
|
||||||
# Copyright 2021 Open Source Integrators
|
# Copyright 2021 Open Source Integrators
|
||||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html)
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html)
|
||||||
|
import base64
|
||||||
import io
|
import io
|
||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
@@ -149,7 +150,7 @@ class IrAttachment(models.Model):
|
|||||||
key = fname.replace("azure://", "", 1).lower()
|
key = fname.replace("azure://", "", 1).lower()
|
||||||
try:
|
try:
|
||||||
blob_client = container_client.get_blob_client(key)
|
blob_client = container_client.get_blob_client(key)
|
||||||
read = blob_client.download_blob().readall()
|
read = base64.b64encode(blob_client.download_blob().readall())
|
||||||
except HttpResponseError:
|
except HttpResponseError:
|
||||||
read = ""
|
read = ""
|
||||||
_logger.info("Attachment '%s' missing on object storage", fname)
|
_logger.info("Attachment '%s' missing on object storage", fname)
|
||||||
|
|||||||
Reference in New Issue
Block a user