mirror of
https://github.com/camptocamp/odoo-cloud-platform.git
synced 2026-06-24 08:47:40 +00:00
fix
This commit is contained in:
@@ -166,9 +166,8 @@ class IrAttachment(osv.osv):
|
|||||||
else:
|
else:
|
||||||
return super(IrAttachment, self)._store_file_read(fname, bin_size)
|
return super(IrAttachment, self)._store_file_read(fname, bin_size)
|
||||||
|
|
||||||
def _store_file_write(self, key, bin_data):
|
def _store_file_write(self, storage, key, bin_data):
|
||||||
location = self.env.context.get("storage_location") or self._storage()
|
if storage == "azure":
|
||||||
if location == "azure":
|
|
||||||
container_client = self._get_azure_container()
|
container_client = self._get_azure_container()
|
||||||
filename = "azure://%s/%s" % (container_client.container_name, key)
|
filename = "azure://%s/%s" % (container_client.container_name, key)
|
||||||
with io.BytesIO() as file:
|
with io.BytesIO() as file:
|
||||||
|
|||||||
@@ -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 FilestoreKind
|
||||||
from openerp.addons.cloud_platform.models.cloud_platform import PlatformConfig
|
from openerp.addons.cloud_platform.models.cloud_platform import PlatformConfig
|
||||||
|
|
||||||
AZURE_STORE_KIND = FilestoreKind("azure", "remote")
|
|
||||||
|
|
||||||
|
|
||||||
class CloudPlatform(osv.osv):
|
class CloudPlatform(osv.osv):
|
||||||
_inherit = "cloud.platform"
|
_inherit = "cloud.platform"
|
||||||
|
|
||||||
def _filestore_kinds(self):
|
def _filestore_kinds(self):
|
||||||
kinds = super(CloudPlatform, self)._filestore_kinds()
|
kinds = super(CloudPlatform, self)._filestore_kinds()
|
||||||
kinds["azure"] = AZURE_STORE_KIND
|
kinds.append("azure")
|
||||||
return kinds
|
return kinds
|
||||||
|
|
||||||
def _platform_kinds(self):
|
def _platform_kinds(self):
|
||||||
|
|||||||
Reference in New Issue
Block a user