From 1fb65e56722516cf138859f1ba4ad94b8b8b347f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Bidoul=20=28ACSONE=29?= Date: Sat, 6 May 2017 18:31:07 +0200 Subject: [PATCH] better addons path detection, including 10.0 support --- travis/test_server.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/travis/test_server.py b/travis/test_server.py index ef98cb93d..151ef4c1a 100755 --- a/travis/test_server.py +++ b/travis/test_server.py @@ -133,10 +133,16 @@ def get_addons_path(travis_dependencies_dir, travis_build_dir, server_path): addons_path_list = get_addons(travis_build_dir) addons_path_list.extend(get_addons(travis_dependencies_dir)) addons_path_list.append(os.path.join(server_path, "addons")) - site_package_addons = os.environ['VIRTUAL_ENV'] + \ - "/lib/python2.7/site-packages/odoo_addons" - if os.path.isdir(site_package_addons): - addons_path_list.append(site_package_addons) + try: + ap = __import__('odoo_addons').__path__ + addons_path_list.extend(ap) + except ImportError: + pass + try: + ap = __import__('odoo.addons').addons.__path__ + addons_path_list.extend(ap) + except ImportError: + pass addons_path = ','.join(addons_path_list) return addons_path