diff --git a/.travis.yml b/.travis.yml index 2655a84..4b30e51 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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 diff --git a/attachment_s3/__openerp__.py b/attachment_s3/__manifest__.py similarity index 95% rename from attachment_s3/__openerp__.py rename to attachment_s3/__manifest__.py index f2c51db..301c3d5 100644 --- a/attachment_s3/__openerp__.py +++ b/attachment_s3/__manifest__.py @@ -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', diff --git a/attachment_s3/models/ir_attachment.py b/attachment_s3/models/ir_attachment.py index 4cacf2c..e843e84 100644 --- a/attachment_s3/models/ir_attachment.py +++ b/attachment_s3/models/ir_attachment.py @@ -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() diff --git a/cloud_platform/__openerp__.py b/cloud_platform/__manifest__.py similarity index 95% rename from cloud_platform/__openerp__.py rename to cloud_platform/__manifest__.py index 26b0b1e..4df4e98 100644 --- a/cloud_platform/__openerp__.py +++ b/cloud_platform/__manifest__.py @@ -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', diff --git a/cloud_platform/models/cloud_platform.py b/cloud_platform/models/cloud_platform.py index 31dd261..2b6417e 100644 --- a/cloud_platform/models/cloud_platform.py +++ b/cloud_platform/models/cloud_platform.py @@ -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() diff --git a/logging_json/__openerp__.py b/logging_json/__manifest__.py similarity index 94% rename from logging_json/__openerp__.py rename to logging_json/__manifest__.py index e73ded2..1d9bad3 100644 --- a/logging_json/__openerp__.py +++ b/logging_json/__manifest__.py @@ -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', diff --git a/monitoring_log_requests/__openerp__.py b/monitoring_log_requests/__manifest__.py similarity index 93% rename from monitoring_log_requests/__openerp__.py rename to monitoring_log_requests/__manifest__.py index 49e73e7..152e9d4 100644 --- a/monitoring_log_requests/__openerp__.py +++ b/monitoring_log_requests/__manifest__.py @@ -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', diff --git a/monitoring_log_requests/models/ir_http.py b/monitoring_log_requests/models/ir_http.py index 1bb6c54..007c31b 100644 --- a/monitoring_log_requests/models/ir_http.py +++ b/monitoring_log_requests/models/ir_http.py @@ -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') diff --git a/monitoring_statsd/__openerp__.py b/monitoring_statsd/__manifest__.py similarity index 94% rename from monitoring_statsd/__openerp__.py rename to monitoring_statsd/__manifest__.py index 2989cd1..ec88473 100644 --- a/monitoring_statsd/__openerp__.py +++ b/monitoring_statsd/__manifest__.py @@ -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', diff --git a/monitoring_statsd/models/ir_http.py b/monitoring_statsd/models/ir_http.py index c2cc0de..11c3d55 100644 --- a/monitoring_statsd/models/ir_http.py +++ b/monitoring_statsd/models/ir_http.py @@ -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 diff --git a/monitoring_statsd/statsd_client.py b/monitoring_statsd/statsd_client.py index d67f08c..c705cb8 100644 --- a/monitoring_statsd/statsd_client.py +++ b/monitoring_statsd/statsd_client.py @@ -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__) diff --git a/monitoring_status/__openerp__.py b/monitoring_status/__manifest__.py similarity index 93% rename from monitoring_status/__openerp__.py rename to monitoring_status/__manifest__.py index f64afb9..e3cb44a 100644 --- a/monitoring_status/__openerp__.py +++ b/monitoring_status/__manifest__.py @@ -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', diff --git a/monitoring_status/controllers/main.py b/monitoring_status/controllers/main.py index 246e066..f54bbb7 100644 --- a/monitoring_status/controllers/main.py +++ b/monitoring_status/controllers/main.py @@ -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): diff --git a/session_redis/README.rst b/session_redis/README.rst index 8a05b14..f201f28 100644 --- a/session_redis/README.rst +++ b/session_redis/README.rst @@ -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. diff --git a/session_redis/__openerp__.py b/session_redis/__manifest__.py similarity index 94% rename from session_redis/__openerp__.py rename to session_redis/__manifest__.py index 3701910..06686ce 100644 --- a/session_redis/__openerp__.py +++ b/session_redis/__manifest__.py @@ -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', diff --git a/session_redis/http.py b/session_redis/http.py index c12ddb2..e7576fd 100644 --- a/session_redis/http.py +++ b/session_redis/http.py @@ -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) diff --git a/session_redis/session.py b/session_redis/session.py index 6ab08b5..8d69b27 100644 --- a/session_redis/session.py +++ b/session_redis/session.py @@ -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__)