[IMP] module.py: remove useless pkg_resources jinja hook

The `PackageLoader` jinja's loader purpose is to discover template files
given a python module path. It was necessary to register a special hook
into the import scheme of Odoo to support `import crm`, `import openerp`
and `import openerp.addons` like module path.

Since the support for those old module paths is deprecated since v13 and
the jinja's team shows desire to remove support to `pkg_resource` utils
as highlighted by #50552, it is better to remove it.

closes odoo/odoo#53515

Task: 2282681
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
This commit is contained in:
Julien Castiaux
2020-08-17 11:14:45 +00:00
committed by Raphael Collet
parent 17ae856cc1
commit 75b8e39bb2
-4
View File
@@ -62,10 +62,6 @@ class AddonsHook(object):
return odoo_module
# need to register loader with setuptools as Jinja relies on it when using
# PackageLoader
pkg_resources.register_loader_type(AddonsHook, pkg_resources.DefaultProvider)
class OdooHook(object):
""" Makes odoo package also available as openerp """