summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXavier Morel <xmo@odoo.com>2020-04-01 08:30:29 +0000
committerXavier Morel <xmo@odoo.com>2020-04-22 11:31:20 +0000
commit9a93d3db11d0cf7e5e10d4d3578aff73d64a4f61 (patch)
tree159315f739fc8f225e51409602de41a8a2586cc8
parentd9c685a75730a55e184ca32b75d82722d3f9091f (diff)
[FIX] *: collection.<ABC> is deprecated
-rw-r--r--odoo/modules/module.py4
-rw-r--r--odoo/osv/expression.py6
2 files changed, 5 insertions, 5 deletions
diff --git a/odoo/modules/module.py b/odoo/modules/module.py
index 88d96949b74..959019d56e8 100644
--- a/odoo/modules/module.py
+++ b/odoo/modules/module.py
@@ -2,7 +2,7 @@
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import ast
-import collections
+import collections.abc
import importlib
import inspect
import itertools
@@ -260,7 +260,7 @@ def load_information_from_description_file(module, mod_path=None):
# auto_install: [] to always auto_install a module regardless of its
# dependencies
auto_install = info.get('auto_install', info.get('active', False))
- if isinstance(auto_install, collections.Iterable):
+ if isinstance(auto_install, collections.abc.Iterable):
info['auto_install'] = set(auto_install)
non_dependencies = info['auto_install'].difference(info['depends'])
assert not non_dependencies,\
diff --git a/odoo/osv/expression.py b/odoo/osv/expression.py
index ce1410b9225..12c2f2df5d7 100644
--- a/odoo/osv/expression.py
+++ b/odoo/osv/expression.py
@@ -113,7 +113,7 @@ Finally, to instruct OpenERP to really use the unaccent function, you have to
start the server specifying the ``--unaccent`` flag.
"""
-import collections
+import collections.abc
import logging
import traceback
@@ -958,7 +958,7 @@ class expression(object):
op2 = (TERM_OPERATORS_NEGATION[operator]
if operator in NEGATIVE_TERM_OPERATORS else operator)
ids2 = [x[0] for x in comodel.name_search(right, domain or [], op2, limit=None)]
- elif isinstance(right, collections.Iterable):
+ elif isinstance(right, collections.abc.Iterable):
ids2 = right
else:
ids2 = [right]
@@ -1018,7 +1018,7 @@ class expression(object):
op2 = (TERM_OPERATORS_NEGATION[operator]
if operator in NEGATIVE_TERM_OPERATORS else operator)
ids2 = [x[0] for x in comodel.name_search(right, domain or [], op2, limit=None)]
- elif isinstance(right, collections.Iterable):
+ elif isinstance(right, collections.abc.Iterable):
ids2 = right
else:
ids2 = [right]