[FIX] module loading: allow addons path entries to have substring of others.
authorChristophe Simonis <chs@openerp.com>
Thu, 7 Mar 2013 13:11:04 +0000 (14:11 +0100)
committerChristophe Matthieu <chm@openerp.com>
Thu, 7 Mar 2013 13:11:04 +0000 (14:11 +0100)
i.e. having ./addons/ and ./addons2/ is now possible

bzr revid: chm@openerp.com-20130307131104-ju2n7zm7yvced68h

openerp/tools/misc.py

index 47a2ae4..fc94068 100644 (file)
@@ -139,6 +139,7 @@ def file_open(name, mode="r", subdir='addons', pathinfo=False):
         # Is it below 'addons_path' or 'root_path'?
         name = os.path.normcase(os.path.normpath(name))
         for root in adps + [rtp]:
+            root = os.path.normcase(os.path.normpath(root)) + os.sep
             if name.startswith(root):
                 base = root.rstrip(os.sep)
                 name = name[len(base) + 1:]