mirror of
https://github.com/camptocamp/odoo-cloud-platform.git
synced 2026-06-23 18:04:34 +00:00
Migrate addons to 10.0
This commit is contained in:
+1
-1
@@ -27,7 +27,7 @@ env:
|
||||
- TESTS="1" ODOO_REPO="odoo/odoo"
|
||||
- TESTS="1" ODOO_REPO="OCA/OCB"
|
||||
global:
|
||||
- VERSION="9.0" LINT_CHECK="0" TESTS="0"
|
||||
- VERSION="10.0" LINT_CHECK="0" TESTS="0"
|
||||
|
||||
install:
|
||||
- git clone --depth=1 https://github.com/OCA/maintainer-quality-tools.git ${HOME}/maintainer-quality-tools
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
{'name': 'Attachments on S3 storage',
|
||||
'summary': 'Store assets and attachments on a S3 compatible object storage',
|
||||
'version': '9.0.1.1.0',
|
||||
'version': '10.0.1.0.0',
|
||||
'author': 'Camptocamp,Odoo Community Association (OCA)',
|
||||
'license': 'AGPL-3',
|
||||
'category': 'Knowledge Management',
|
||||
@@ -12,8 +12,8 @@ from functools import partial
|
||||
|
||||
import psycopg2
|
||||
|
||||
import openerp
|
||||
from openerp import _, api, exceptions, models, SUPERUSER_ID
|
||||
import odoo
|
||||
from odoo import _, api, exceptions, models
|
||||
from ..s3uri import S3Uri
|
||||
|
||||
_logger = logging.getLogger(__name__)
|
||||
@@ -264,7 +264,7 @@ class IrAttachment(models.Model):
|
||||
"""
|
||||
with api.Environment.manage():
|
||||
if new_cr:
|
||||
registry = openerp.modules.registry.RegistryManager.get(
|
||||
registry = odoo.modules.registry.RegistryManager.get(
|
||||
self.env.cr.dbname
|
||||
)
|
||||
with closing(registry.cursor()) as cr:
|
||||
@@ -289,12 +289,11 @@ class IrAttachment(models.Model):
|
||||
else:
|
||||
return super(IrAttachment, self).force_storage()
|
||||
|
||||
@api.cr
|
||||
def _register_hook(self, cr):
|
||||
@api.model_cr
|
||||
def _register_hook(self):
|
||||
# We need to call the migration on the loading of the model
|
||||
# because when we are upgrading addons, some of them might
|
||||
# add attachments, and to be sure the are migrated to S3,
|
||||
# we need to call the migration here.
|
||||
super(IrAttachment, self)._register_hook(cr)
|
||||
env = api.Environment(cr, SUPERUSER_ID, {})
|
||||
env['ir.attachment']._force_storage_s3()
|
||||
super(IrAttachment, self)._register_hook()
|
||||
self.sudo()._force_storage_s3()
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
{'name': 'Cloud Platform',
|
||||
'summary': 'Addons required for the Camptocamp Cloud Platform',
|
||||
'version': '9.0.1.0.0',
|
||||
'version': '10.0.1.0.0',
|
||||
'author': 'Camptocamp,Odoo Community Association (OCA)',
|
||||
'license': 'AGPL-3',
|
||||
'category': 'Extra Tools',
|
||||
@@ -10,8 +10,8 @@ from collections import namedtuple
|
||||
|
||||
from distutils.util import strtobool
|
||||
|
||||
from openerp import api, models, SUPERUSER_ID
|
||||
from openerp.tools.config import config
|
||||
from odoo import api, models
|
||||
from odoo.tools.config import config
|
||||
|
||||
|
||||
_logger = logging.getLogger(__name__)
|
||||
@@ -124,8 +124,7 @@ class CloudPlatform(models.AbstractModel):
|
||||
self._check_redis(environment_name)
|
||||
self._check_metrics(environment_name)
|
||||
|
||||
@api.cr
|
||||
def _register_hook(self, cr):
|
||||
super(CloudPlatform, self)._register_hook(cr)
|
||||
env = api.Environment(cr, SUPERUSER_ID, {})
|
||||
env['cloud.platform'].check()
|
||||
@api.model_cr
|
||||
def _register_hook(self):
|
||||
super(CloudPlatform, self)._register_hook()
|
||||
self.sudo().check()
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html)
|
||||
|
||||
{'name': 'JSON Logging',
|
||||
'version': '9.0.1.0.0',
|
||||
'version': '10.0.1.0.0',
|
||||
'author': 'Camptocamp,Odoo Community Association (OCA)',
|
||||
'license': 'AGPL-3',
|
||||
'category': 'Extra Tools',
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
|
||||
{'name': 'Monitoring: Requests Logging',
|
||||
'version': '9.0.1.0.0',
|
||||
'version': '10.0.1.0.0',
|
||||
'author': 'Camptocamp,Odoo Community Association (OCA)',
|
||||
'license': 'AGPL-3',
|
||||
'category': 'category',
|
||||
@@ -6,9 +6,9 @@ import json
|
||||
import logging
|
||||
import time
|
||||
|
||||
from openerp import models
|
||||
from openerp.http import request as http_request
|
||||
from openerp.tools.config import config
|
||||
from odoo import models
|
||||
from odoo.http import request as http_request
|
||||
from odoo.tools.config import config
|
||||
|
||||
|
||||
_logger = logging.getLogger('monitoring.http.requests')
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
|
||||
{'name': 'Monitoring: Statsd Metrics',
|
||||
'version': '9.0.1.0.0',
|
||||
'version': '10.0.1.0.0',
|
||||
'author': 'Camptocamp',
|
||||
'license': 'AGPL-3',
|
||||
'category': 'category',
|
||||
@@ -2,8 +2,8 @@
|
||||
# Copyright 2016 Camptocamp SA
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html)
|
||||
|
||||
from openerp import models
|
||||
from openerp.http import request
|
||||
from odoo import models
|
||||
from odoo.http import request
|
||||
|
||||
from ..statsd_client import statsd, customer, environment
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ import os
|
||||
|
||||
from distutils.util import strtobool
|
||||
|
||||
from openerp.tools.config import config
|
||||
from odoo.tools.config import config
|
||||
|
||||
_logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
|
||||
{'name': 'Monitoring: Status',
|
||||
'version': '9.0.1.0.0',
|
||||
'version': '10.0.1.0.0',
|
||||
'author': 'Camptocamp,Odoo Community Association (OCA)',
|
||||
'license': 'AGPL-3',
|
||||
'category': 'category',
|
||||
@@ -6,8 +6,8 @@ import json
|
||||
|
||||
import werkzeug
|
||||
|
||||
from openerp import http
|
||||
from openerp.addons.web.controllers.main import ensure_db
|
||||
from odoo import http
|
||||
from odoo.addons.web.controllers.main import ensure_db
|
||||
|
||||
|
||||
class Monitoring(http.Controller):
|
||||
|
||||
@@ -32,6 +32,6 @@ Limitations
|
||||
Redis.
|
||||
* All the users will have to login again as their previous session will be
|
||||
dropped.
|
||||
* The addon monkey-patch ``openerp.http.Root.session_store`` with a custom
|
||||
* The addon monkey-patch ``odoo.http.Root.session_store`` with a custom
|
||||
method when the Redis mode is active, so incompatibilities with other addons
|
||||
is possible if they do the same.
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
{'name': 'Sessions in Redis',
|
||||
'summary': 'Store web sessions in Redis',
|
||||
'version': '9.0.1.0.0',
|
||||
'version': '10.0.1.0.0',
|
||||
'author': 'Camptocamp,Odoo Community Association (OCA)',
|
||||
'license': 'AGPL-3',
|
||||
'category': 'Extra Tools',
|
||||
@@ -7,9 +7,9 @@ import os
|
||||
|
||||
from distutils.util import strtobool
|
||||
|
||||
import openerp
|
||||
from openerp import http
|
||||
from openerp.tools.func import lazy_property
|
||||
import odoo
|
||||
from odoo import http
|
||||
from odoo.tools.func import lazy_property
|
||||
|
||||
from .session import RedisSessionStore
|
||||
|
||||
@@ -65,4 +65,4 @@ if is_true(os.environ.get('ODOO_SESSION_REDIS')):
|
||||
http.Root.session_store = session_store
|
||||
http.session_gc = session_gc
|
||||
# clean the existing sessions on the file system
|
||||
purge_fs_sessions(openerp.tools.config.session_dir)
|
||||
purge_fs_sessions(odoo.tools.config.session_dir)
|
||||
|
||||
@@ -8,7 +8,7 @@ import logging
|
||||
from werkzeug.contrib.sessions import SessionStore
|
||||
|
||||
# this is equal to the duration of the session garbage collector in
|
||||
# openerp.http.session_gc()
|
||||
# odoo.http.session_gc()
|
||||
DEFAULT_SESSION_TIMEOUT = 60 * 60 * 24 * 7 # 7 days in seconds
|
||||
|
||||
_logger = logging.getLogger(__name__)
|
||||
|
||||
Reference in New Issue
Block a user