mirror of
https://github.com/camptocamp/odoo-cloud-platform.git
synced 2026-06-23 18:04:34 +00:00
Abstract install method
This commit is contained in:
committed by
Guewen Baconnier
co-authored by
Guewen Baconnier
parent
66748534f6
commit
1548fd674a
@@ -1,11 +1,10 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright 2016 Camptocamp SA
|
||||
# Copyright 2017 Camptocamp SA
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html)
|
||||
|
||||
import logging
|
||||
|
||||
from odoo import api, models
|
||||
from odoo.tools.config import config
|
||||
|
||||
_logger = logging.getLogger(__name__)
|
||||
|
||||
@@ -30,15 +29,3 @@ class CloudPlatform(models.AbstractModel):
|
||||
'dev': PlatformConfig(filestore=FilestoreKind.db),
|
||||
}
|
||||
return configs.get(environment) or configs['dev']
|
||||
|
||||
@api.model
|
||||
def install_ovh(self):
|
||||
params = self.env['ir.config_parameter'].sudo()
|
||||
params.set_param('cloud.platform.kind', 'ovh')
|
||||
environment = config['running_env']
|
||||
configs = self._config_by_server_env(environment)
|
||||
params.set_param('ir_attachment.location', configs.filestore)
|
||||
self.check()
|
||||
if configs.filestore == FilestoreKind.swift:
|
||||
self.env['ir.attachment'].sudo().force_storage()
|
||||
_logger.info('cloud platform configured for ovh')
|
||||
|
||||
Reference in New Issue
Block a user