From 43ed7178af0ece489e0ccb46d9ca0479a9b54a6c Mon Sep 17 00:00:00 2001 From: vrenaville Date: Thu, 12 May 2022 14:43:54 +0200 Subject: [PATCH] fix --- attachment_azure/models/ir_attachment.py | 5 ++--- cloud_platform_azure/models/cloud_platform.py | 4 +--- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/attachment_azure/models/ir_attachment.py b/attachment_azure/models/ir_attachment.py index 40c2072..b6aaebc 100644 --- a/attachment_azure/models/ir_attachment.py +++ b/attachment_azure/models/ir_attachment.py @@ -166,9 +166,8 @@ class IrAttachment(osv.osv): else: return super(IrAttachment, self)._store_file_read(fname, bin_size) - def _store_file_write(self, key, bin_data): - location = self.env.context.get("storage_location") or self._storage() - if location == "azure": + def _store_file_write(self, storage, key, bin_data): + if storage == "azure": container_client = self._get_azure_container() filename = "azure://%s/%s" % (container_client.container_name, key) with io.BytesIO() as file: diff --git a/cloud_platform_azure/models/cloud_platform.py b/cloud_platform_azure/models/cloud_platform.py index 472ebc6..8fd0233 100644 --- a/cloud_platform_azure/models/cloud_platform.py +++ b/cloud_platform_azure/models/cloud_platform.py @@ -8,15 +8,13 @@ from openerp.osv import osv from openerp.addons.cloud_platform.models.cloud_platform import FilestoreKind from openerp.addons.cloud_platform.models.cloud_platform import PlatformConfig -AZURE_STORE_KIND = FilestoreKind("azure", "remote") - class CloudPlatform(osv.osv): _inherit = "cloud.platform" def _filestore_kinds(self): kinds = super(CloudPlatform, self)._filestore_kinds() - kinds["azure"] = AZURE_STORE_KIND + kinds.append("azure") return kinds def _platform_kinds(self):