From b11aee0eaa14650407f408f06309f736c25f2929 Mon Sep 17 00:00:00 2001 From: Simone Orsi Date: Mon, 3 Sep 2018 10:00:27 +0200 Subject: [PATCH] Global pylint cleanup --- base_cron_exclusion/models/ir_cron.py | 10 +++++----- base_technical_user/README.rst | 2 +- database_cleanup/__init__.py | 3 +-- database_cleanup/__manifest__.py | 3 +-- database_cleanup/identifier_adapter.py | 3 +-- database_cleanup/models/create_indexes.py | 4 ++-- database_cleanup/models/purge_columns.py | 4 ++-- database_cleanup/models/purge_data.py | 3 +-- database_cleanup/models/purge_menus.py | 4 ++-- database_cleanup/models/purge_models.py | 4 ++-- database_cleanup/models/purge_modules.py | 4 ++-- database_cleanup/models/purge_properties.py | 4 ++-- database_cleanup/models/purge_tables.py | 4 ++-- database_cleanup/models/purge_wizard.py | 5 +++-- database_cleanup/tests/__init__.py | 3 +-- database_cleanup/tests/test_database_cleanup.py | 3 +-- module_auto_update/addon_hash.py | 1 - .../migrations/10.0.2.0.0/pre-migrate.py | 1 - module_auto_update/models/module.py | 1 - module_auto_update/models/module_deprecated.py | 1 + .../tests/sample_module/static/src/some.js | 2 +- module_auto_update/tests/test_addon_hash.py | 1 - module_auto_update/tests/test_module.py | 1 - module_auto_update/tests/test_module_deprecated.py | 3 +-- scheduler_error_mailer/__init__.py | 1 - sentry/__init__.py | 1 - sentry/__manifest__.py | 1 - sentry/const.py | 1 - sentry/logutils.py | 1 - sentry/tests/__init__.py | 1 - sentry/tests/test_client.py | 1 - sentry/tests/test_logutils.py | 1 - 32 files changed, 32 insertions(+), 50 deletions(-) diff --git a/base_cron_exclusion/models/ir_cron.py b/base_cron_exclusion/models/ir_cron.py index a6ad8591c..499b774ac 100644 --- a/base_cron_exclusion/models/ir_cron.py +++ b/base_cron_exclusion/models/ir_cron.py @@ -14,13 +14,13 @@ _logger = logging.getLogger(__name__) class IrCron(models.Model): _inherit = "ir.cron" - @api.one @api.constrains('mutually_exclusive_cron_ids') def _check_auto_exclusion(self): - if self in self.mutually_exclusive_cron_ids: - raise ValidationError(_( - "You can not mutually exclude a scheduled actions with " - "itself.")) + for item in self: + if item in item.mutually_exclusive_cron_ids: + raise ValidationError(_( + "You can not mutually exclude a scheduled actions with " + "itself.")) mutually_exclusive_cron_ids = fields.Many2many( comodel_name="ir.cron", relation="ir_cron_exclusion", diff --git a/base_technical_user/README.rst b/base_technical_user/README.rst index cd3cbe932..3ae5b189b 100644 --- a/base_technical_user/README.rst +++ b/base_technical_user/README.rst @@ -50,4 +50,4 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use. -To contribute to this module, please visit http://odoo-community.org. \ No newline at end of file +To contribute to this module, please visit http://odoo-community.org. diff --git a/database_cleanup/__init__.py b/database_cleanup/__init__.py index 851a78463..b19ab1b09 100644 --- a/database_cleanup/__init__.py +++ b/database_cleanup/__init__.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- -# © 2014-2016 Therp BV +# Copyright 2014-2016 Therp BV # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from . import models diff --git a/database_cleanup/__manifest__.py b/database_cleanup/__manifest__.py index 192483da0..b2737fff7 100644 --- a/database_cleanup/__manifest__.py +++ b/database_cleanup/__manifest__.py @@ -1,5 +1,4 @@ -# -*- coding: utf-8 -*- -# © 2014-2016 Therp BV +# Copyright 2014-2016 Therp BV # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). { 'name': 'Database cleanup', diff --git a/database_cleanup/identifier_adapter.py b/database_cleanup/identifier_adapter.py index 008044689..a10dc2e00 100644 --- a/database_cleanup/identifier_adapter.py +++ b/database_cleanup/identifier_adapter.py @@ -1,5 +1,4 @@ -# -*- coding: utf-8 -*- -# © 2016 Therp BV +# Copyright 2016 Therp BV # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from psycopg2.extensions import ISQLQuote diff --git a/database_cleanup/models/create_indexes.py b/database_cleanup/models/create_indexes.py index 8aa072f68..9ff571522 100644 --- a/database_cleanup/models/create_indexes.py +++ b/database_cleanup/models/create_indexes.py @@ -1,6 +1,6 @@ -# -*- coding: utf-8 -*- -# © 2017 Therp BV +# Copyright 2017 Therp BV # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +# pylint: disable=consider-merging-classes-inherited from ..identifier_adapter import IdentifierAdapter from odoo import api, fields, models diff --git a/database_cleanup/models/purge_columns.py b/database_cleanup/models/purge_columns.py index 6050ae2dd..c3c248d6b 100644 --- a/database_cleanup/models/purge_columns.py +++ b/database_cleanup/models/purge_columns.py @@ -1,6 +1,6 @@ -# -*- coding: utf-8 -*- -# © 2014-2016 Therp BV +# Copyright 2014-2016 Therp BV # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +# pylint: disable=consider-merging-classes-inherited from odoo import _, api, fields, models from odoo.exceptions import UserError from ..identifier_adapter import IdentifierAdapter diff --git a/database_cleanup/models/purge_data.py b/database_cleanup/models/purge_data.py index f7ca49dee..efe224a59 100644 --- a/database_cleanup/models/purge_data.py +++ b/database_cleanup/models/purge_data.py @@ -1,5 +1,4 @@ -# -*- coding: utf-8 -*- -# © 2014-2016 Therp BV +# Copyright 2014-2016 Therp BV # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from odoo import _, api, fields, models from odoo.exceptions import UserError diff --git a/database_cleanup/models/purge_menus.py b/database_cleanup/models/purge_menus.py index bd6f3c8cb..b74366161 100644 --- a/database_cleanup/models/purge_menus.py +++ b/database_cleanup/models/purge_menus.py @@ -1,6 +1,6 @@ -# -*- coding: utf-8 -*- -# © 2014-2016 Therp BV +# Copyright 2014-2016 Therp BV # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +# pylint: disable=consider-merging-classes-inherited from odoo import _, api, fields, models from odoo.exceptions import UserError diff --git a/database_cleanup/models/purge_models.py b/database_cleanup/models/purge_models.py index 36e9e2812..42c96d80b 100644 --- a/database_cleanup/models/purge_models.py +++ b/database_cleanup/models/purge_models.py @@ -1,6 +1,6 @@ -# -*- coding: utf-8 -*- -# © 2014-2016 Therp BV +# Copyright 2014-2016 Therp BV # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +# pylint: disable=consider-merging-classes-inherited from odoo import _, api, models, fields from odoo.exceptions import UserError from odoo.addons.base.ir.ir_model import MODULE_UNINSTALL_FLAG diff --git a/database_cleanup/models/purge_modules.py b/database_cleanup/models/purge_modules.py index 40776f68e..ed8c03a0a 100644 --- a/database_cleanup/models/purge_modules.py +++ b/database_cleanup/models/purge_modules.py @@ -1,6 +1,6 @@ -# -*- coding: utf-8 -*- -# © 2014-2016 Therp BV +# Copyright 2014-2016 Therp BV # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +# pylint: disable=consider-merging-classes-inherited from odoo import _, api, fields, models from odoo.exceptions import UserError from odoo.modules.module import get_module_path diff --git a/database_cleanup/models/purge_properties.py b/database_cleanup/models/purge_properties.py index 7adbf440b..9cd32d3f0 100644 --- a/database_cleanup/models/purge_properties.py +++ b/database_cleanup/models/purge_properties.py @@ -1,6 +1,6 @@ -# -*- coding: utf-8 -*- -# © 2017 Therp BV +# Copyright 2017 Therp BV # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +# pylint: disable=consider-merging-classes-inherited from odoo import api, models, fields REASON_DUPLICATE = 1 REASON_DEFAULT = 2 diff --git a/database_cleanup/models/purge_tables.py b/database_cleanup/models/purge_tables.py index 808c42490..275956f83 100644 --- a/database_cleanup/models/purge_tables.py +++ b/database_cleanup/models/purge_tables.py @@ -1,6 +1,6 @@ -# -*- coding: utf-8 -*- -# © 2014-2016 Therp BV +# Copyright 2014-2016 Therp BV # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +# pylint: disable=consider-merging-classes-inherited from odoo import api, fields, models, _ from odoo.exceptions import UserError from ..identifier_adapter import IdentifierAdapter diff --git a/database_cleanup/models/purge_wizard.py b/database_cleanup/models/purge_wizard.py index d678645b4..b14af48e8 100644 --- a/database_cleanup/models/purge_wizard.py +++ b/database_cleanup/models/purge_wizard.py @@ -1,6 +1,7 @@ -# -*- coding: utf-8 -*- -# © 2014-2016 Therp BV +# Copyright 2014-2016 Therp BV # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +# pylint: disable=consider-merging-classes-inherited + import logging from odoo import _, api, fields, models from odoo.exceptions import AccessDenied diff --git a/database_cleanup/tests/__init__.py b/database_cleanup/tests/__init__.py index 265497c37..298a513e2 100644 --- a/database_cleanup/tests/__init__.py +++ b/database_cleanup/tests/__init__.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- -# © 2016 Therp BV +# Copyright 2016 Therp BV # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from . import test_database_cleanup diff --git a/database_cleanup/tests/test_database_cleanup.py b/database_cleanup/tests/test_database_cleanup.py index 75265ddb9..28b817a54 100644 --- a/database_cleanup/tests/test_database_cleanup.py +++ b/database_cleanup/tests/test_database_cleanup.py @@ -1,5 +1,4 @@ -# -*- coding: utf-8 -*- -# © 2016 Therp BV +# Copyright 2016 Therp BV # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from psycopg2 import ProgrammingError from odoo.modules.registry import Registry diff --git a/module_auto_update/addon_hash.py b/module_auto_update/addon_hash.py index dea52b4f2..6bcbebf5a 100644 --- a/module_auto_update/addon_hash.py +++ b/module_auto_update/addon_hash.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright 2018 ACSONE SA/NV. # License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). diff --git a/module_auto_update/migrations/10.0.2.0.0/pre-migrate.py b/module_auto_update/migrations/10.0.2.0.0/pre-migrate.py index 92135d174..da98ab3ca 100644 --- a/module_auto_update/migrations/10.0.2.0.0/pre-migrate.py +++ b/module_auto_update/migrations/10.0.2.0.0/pre-migrate.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright 2018 Tecnativa - Jairo Llopis # License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl). import logging diff --git a/module_auto_update/models/module.py b/module_auto_update/models/module.py index e561abe5a..aee072ac6 100644 --- a/module_auto_update/models/module.py +++ b/module_auto_update/models/module.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright 2017 LasLabs Inc. # Copyright 2018 ACSONE SA/NV. # License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). diff --git a/module_auto_update/models/module_deprecated.py b/module_auto_update/models/module_deprecated.py index 0cb9defaa..7383a8ac5 100644 --- a/module_auto_update/models/module_deprecated.py +++ b/module_auto_update/models/module_deprecated.py @@ -1,5 +1,6 @@ # Copyright 2017 LasLabs Inc. # License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). +# pylint: disable=consider-merging-classes-inherited from odoo import api, fields, models diff --git a/module_auto_update/tests/sample_module/static/src/some.js b/module_auto_update/tests/sample_module/static/src/some.js index 64797d825..896fe66fe 100644 --- a/module_auto_update/tests/sample_module/static/src/some.js +++ b/module_auto_update/tests/sample_module/static/src/some.js @@ -1 +1 @@ -/* javascript */ +/* Javascript */ diff --git a/module_auto_update/tests/test_addon_hash.py b/module_auto_update/tests/test_addon_hash.py index 290375762..884645168 100644 --- a/module_auto_update/tests/test_addon_hash.py +++ b/module_auto_update/tests/test_addon_hash.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright 2018 ACSONE SA/NV. # License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). diff --git a/module_auto_update/tests/test_module.py b/module_auto_update/tests/test_module.py index 493f75dfe..e424f7701 100644 --- a/module_auto_update/tests/test_module.py +++ b/module_auto_update/tests/test_module.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright 2017 LasLabs Inc. # Copyright 2018 ACSONE SA/NV. # License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). diff --git a/module_auto_update/tests/test_module_deprecated.py b/module_auto_update/tests/test_module_deprecated.py index a83881d11..ca0434fc8 100644 --- a/module_auto_update/tests/test_module_deprecated.py +++ b/module_auto_update/tests/test_module_deprecated.py @@ -9,8 +9,7 @@ from odoo.modules import get_module_path from odoo.tests.common import TransactionCase from odoo.tools import mute_logger -from odoo.addons.module_auto_update.addon_hash import addon_hash - +from .. addon_hash import addon_hash from ..models.module_deprecated import PARAM_DEPRECATED diff --git a/scheduler_error_mailer/__init__.py b/scheduler_error_mailer/__init__.py index cca6d9455..f55583a17 100644 --- a/scheduler_error_mailer/__init__.py +++ b/scheduler_error_mailer/__init__.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # © 2012-2013 Akretion Sébastien BEAU,David Beal,Alexis de Lattre # © 2016 Sodexis # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). diff --git a/sentry/__init__.py b/sentry/__init__.py index 97da0a4b4..968f6ae31 100644 --- a/sentry/__init__.py +++ b/sentry/__init__.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright 2016-2017 Versada # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). diff --git a/sentry/__manifest__.py b/sentry/__manifest__.py index 08a534483..ea73d423d 100644 --- a/sentry/__manifest__.py +++ b/sentry/__manifest__.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright 2016-2017 Versada # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). { diff --git a/sentry/const.py b/sentry/const.py index b6cacf5f0..0092d7544 100644 --- a/sentry/const.py +++ b/sentry/const.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright 2016-2017 Versada # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). diff --git a/sentry/logutils.py b/sentry/logutils.py index ae42af365..cef132bd7 100644 --- a/sentry/logutils.py +++ b/sentry/logutils.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright 2016-2017 Versada # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). diff --git a/sentry/tests/__init__.py b/sentry/tests/__init__.py index 50cb79814..6955e47d5 100644 --- a/sentry/tests/__init__.py +++ b/sentry/tests/__init__.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright 2016-2017 Versada # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). diff --git a/sentry/tests/test_client.py b/sentry/tests/test_client.py index f75a09089..aafe9d0e7 100644 --- a/sentry/tests/test_client.py +++ b/sentry/tests/test_client.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright 2016-2017 Versada # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). diff --git a/sentry/tests/test_logutils.py b/sentry/tests/test_logutils.py index b81b69162..bcabdcb6a 100644 --- a/sentry/tests/test_logutils.py +++ b/sentry/tests/test_logutils.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright 2016-2017 Versada # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).