Migrate addons to 10.0

This commit is contained in:
Guewen Baconnier
2016-12-21 21:29:09 +01:00
parent 022f9003e8
commit 8e4b461c75
17 changed files with 35 additions and 37 deletions
+1 -1
View File
@@ -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',
+7 -8
View File
@@ -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',
+6 -7
View File
@@ -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',
+3 -3
View File
@@ -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 -2
View File
@@ -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
+1 -1
View File
@@ -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',
+2 -2
View File
@@ -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):
+1 -1
View File
@@ -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',
+4 -4
View File
@@ -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)
+1 -1
View File
@@ -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__)