Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
vrenaville committed May 12, 2022
1 parent 0b4d6f2 commit 43ed717
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
5 changes: 2 additions & 3 deletions attachment_azure/models/ir_attachment.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,9 +166,8 @@ def _store_file_read(self, fname, bin_size=False):
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:
Expand Down
4 changes: 1 addition & 3 deletions cloud_platform_azure/models/cloud_platform.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,13 @@
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):
Expand Down

0 comments on commit 43ed717

Please sign in to comment.