Abstract install method

This commit is contained in:
Thierry Ducrest
2017-09-19 16:30:51 +02:00
committed by Guewen Baconnier
co-authored by Guewen Baconnier
parent 66748534f6
commit 1548fd674a
4 changed files with 24 additions and 22 deletions
+1 -14
View File
@@ -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')