[FIX] oe: listing of modules only take directories having a __openerp__.py file
authorChristophe Simonis <chs@openerp.com>
Thu, 31 Oct 2013 15:27:16 +0000 (16:27 +0100)
committerChristophe Simonis <chs@openerp.com>
Thu, 31 Oct 2013 15:27:16 +0000 (16:27 +0100)
bzr revid: chs@openerp.com-20131031152716-sda5397b4n0be1ih

openerpcommand/common.py

index 45c2742..443f749 100644 (file)
@@ -40,8 +40,7 @@ def get_addons_from_paths(paths, exclude):
     module_names = []
     for p in paths:
         if os.path.exists(p):
-            names = list(set(os.listdir(p)))
-            names = filter(lambda a: not (a.startswith('.') or a in exclude), names)
+            names = [n for n in os.listdir(p) if os.path.isfile(os.path.join(p, n, '__openerp__.py')) and not n.startswith('.') and n not in exclude]
             module_names.extend(names)
         else:
             print "The addons path `%s` doesn't exist." % p