mirror of
https://github.com/camptocamp/odoo-cloud-platform.git
synced 2026-06-23 18:04:34 +00:00
Configure storage by platform kind
This commit is contained in:
@@ -9,8 +9,8 @@ from odoo import api, models
|
||||
_logger = logging.getLogger(__name__)
|
||||
|
||||
try:
|
||||
from ...cloud_platform.models.cloud_platform import FilestoreKind
|
||||
from ...cloud_platform.models.cloud_platform import PlatformConfig
|
||||
from odoo.addons.cloud_platform.models.cloud_platform import FilestoreKind
|
||||
from odoo.addons.cloud_platform.models.cloud_platform import PlatformConfig
|
||||
except ImportError:
|
||||
FilestoreKind = None
|
||||
PlatformConfig = None
|
||||
@@ -21,14 +21,20 @@ class CloudPlatform(models.AbstractModel):
|
||||
_inherit = 'cloud.platform'
|
||||
|
||||
@api.model
|
||||
def _config_by_server_env(self, environment):
|
||||
def _platform_kinds(self):
|
||||
kinds = super(CloudPlatform, self)._platform_kinds()
|
||||
kinds.append('ovh')
|
||||
return kinds
|
||||
|
||||
@api.model
|
||||
def _config_by_server_env_for_ovh(self):
|
||||
configs = {
|
||||
'prod': PlatformConfig(filestore=FilestoreKind.swift),
|
||||
'integration': PlatformConfig(filestore=FilestoreKind.swift),
|
||||
'test': PlatformConfig(filestore=FilestoreKind.db),
|
||||
'dev': PlatformConfig(filestore=FilestoreKind.db),
|
||||
}
|
||||
return configs.get(environment) or configs['dev']
|
||||
return configs
|
||||
|
||||
@api.model
|
||||
def install_ovh(self):
|
||||
|
||||
Reference in New Issue
Block a user