From 04b14947ba3cedfdfedf59be3d9a840945daf843 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mois=C3=A9s=20L=C3=B3pez?= Date: Mon, 21 Nov 2016 02:43:49 +0000 Subject: [PATCH] [REF] attribute-deprecated: Deprecate length class attribute Related issue: https://github.com/OCA/maintainer-quality-tools/issues/385 and https://github.com/odoo/odoo/issues/13780 --- pylint_odoo/checkers/no_modules.py | 2 +- pylint_odoo/test/main.py | 2 +- pylint_odoo/test_repo/broken_module/models/broken_model.py | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/pylint_odoo/checkers/no_modules.py b/pylint_odoo/checkers/no_modules.py index 82eed77f..9214a463 100644 --- a/pylint_odoo/checkers/no_modules.py +++ b/pylint_odoo/checkers/no_modules.py @@ -191,7 +191,7 @@ 'Other OSI approved licence', 'Other proprietary', ] DFTL_ATTRIBUTE_DEPRECATED = [ - '_columns', '_defaults', + '_columns', '_defaults', 'length', ] DFTL_METHOD_REQUIRED_SUPER = [ 'create', 'write', 'read', 'unlink', 'copy', diff --git a/pylint_odoo/test/main.py b/pylint_odoo/test/main.py index 275fb4c2..867fdceb 100644 --- a/pylint_odoo/test/main.py +++ b/pylint_odoo/test/main.py @@ -12,7 +12,7 @@ EXPECTED_ERRORS = { 'api-one-deprecated': 4, 'api-one-multi-together': 2, - 'attribute-deprecated': 2, + 'attribute-deprecated': 3, 'class-camelcase': 1, 'consider-merging-classes-inherited': 2, 'copy-wo-api-one': 2, diff --git a/pylint_odoo/test_repo/broken_module/models/broken_model.py b/pylint_odoo/test_repo/broken_module/models/broken_model.py index 9760ca48..bf2c10ae 100644 --- a/pylint_odoo/test_repo/broken_module/models/broken_model.py +++ b/pylint_odoo/test_repo/broken_module/models/broken_model.py @@ -20,6 +20,7 @@ class TestModel(models.Model): _columns = {} # deprecated columns _defaults = {} # deprecated defaults + length = fields.Integer() # Deprecated length by js errors name = fields.Char( _(u"Näme"), # Don't need translate