diff options
Diffstat (limited to 'odoo')
| -rw-r--r-- | odoo/addons/test_pylint/tests/test_pylint.py | 7 | ||||
| -rw-r--r-- | odoo/fields.py | 3 | ||||
| -rw-r--r-- | odoo/modules/migration.py | 3 | ||||
| -rw-r--r-- | odoo/tools/misc.py | 2 | ||||
| -rw-r--r-- | odoo/tools/pycompat.py | 2 | ||||
| -rw-r--r-- | odoo/tools/xml_utils.py | 2 |
6 files changed, 11 insertions, 8 deletions
diff --git a/odoo/addons/test_pylint/tests/test_pylint.py b/odoo/addons/test_pylint/tests/test_pylint.py index e067c87a5fe..dcea3ba01b1 100644 --- a/odoo/addons/test_pylint/tests/test_pylint.py +++ b/odoo/addons/test_pylint/tests/test_pylint.py @@ -24,9 +24,10 @@ _logger = logging.getLogger(__name__) class TestPyLint(TransactionCase): ENABLED_CODES = [ - 'E0601', # using variable before assignment - 'W0123', # eval used - 'W0101', # unreachable code + 'used-before-assignment', + 'undefined-variable', + 'eval-used', + 'unreachable', 'mixed-indentation', diff --git a/odoo/fields.py b/odoo/fields.py index a1f434db849..58f7dc67dcb 100644 --- a/odoo/fields.py +++ b/odoo/fields.py @@ -1630,7 +1630,8 @@ class Datetime(Field): # Received data is returned as buffer (in Python 2) or memoryview (in Python 3). _BINARY = memoryview if pycompat.PY2: - _BINARY = buffer #pylint: disable=buffer-builtin + #pylint: disable=buffer-builtin,undefined-variable + _BINARY = buffer class Binary(Field): type = 'binary' diff --git a/odoo/modules/migration.py b/odoo/modules/migration.py index e512d331caa..28a9c1c170d 100644 --- a/odoo/modules/migration.py +++ b/odoo/modules/migration.py @@ -21,7 +21,8 @@ if pycompat.PY2: fp, fname = tools.file_open(path, pathinfo=True) fp2 = None - if not isinstance(fp, file): # pylint: disable=file-builtin + # pylint: disable=file-builtin,undefined-variable + if not isinstance(fp, file): # imp.load_source need a real file object, so we create # one from the file-like object we get from file_open fp2 = os.tmpfile() diff --git a/odoo/tools/misc.py b/odoo/tools/misc.py index 2f43c58e02d..17518ce1525 100644 --- a/odoo/tools/misc.py +++ b/odoo/tools/misc.py @@ -1069,7 +1069,7 @@ def formatLang(env, value, digits=None, grouping=True, monetary=False, dp=False, digits = decimal_precision_obj.precision_get(dp) elif currency_obj: digits = currency_obj.decimal_places - elif (hasattr(value, '_field') and isinstance(value._field, (float_field, function_field)) and value._field.digits): + elif (hasattr(value, '_field') and getattr(value._field, 'digits', None)): digits = value._field.digits[1] if not digits and digits is not 0: digits = DEFAULT_DIGITS diff --git a/odoo/tools/pycompat.py b/odoo/tools/pycompat.py index 14195c4fa79..5f25e23e977 100644 --- a/odoo/tools/pycompat.py +++ b/odoo/tools/pycompat.py @@ -13,7 +13,7 @@ PY2 = sys.version_info[0] == 2 _Writer = collections.namedtuple('_Writer', 'writerow writerows') if PY2: - # pylint: disable=long-builtin,unichr-builtin,unicode-builtin + # pylint: disable=long-builtin,unichr-builtin,unicode-builtin,undefined-variable unichr = unichr text_type = unicode string_types = (str, unicode) diff --git a/odoo/tools/xml_utils.py b/odoo/tools/xml_utils.py index 864f1ce0caa..eb5b8b203bf 100644 --- a/odoo/tools/xml_utils.py +++ b/odoo/tools/xml_utils.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- from lxml import etree from odoo.tools.misc import file_open - +from odoo.exceptions import UserError def check_with_xsd(tree_or_str, stream): raise UserError("Method 'check_with_xsd' deprecated ") |
