Merge branch 'master' of https://github.com/odoo/odoo
[odoo/odoo.git] / openerp / tools / misc.py
index 55038f4..7f69f28 100644 (file)
@@ -66,8 +66,11 @@ _logger = logging.getLogger(__name__)
 SKIPPED_ELEMENT_TYPES = (etree._Comment, etree._ProcessingInstruction, etree.CommentBase, etree.PIBase)
 
 def find_in_path(name):
+    path = os.environ.get('PATH', os.defpath).split(os.pathsep)
+    if config.get('bin_path') and config['bin_path'] != 'None':
+        path.append(config['bin_path'])
     try:
-        return which(name)
+        return which(name, path=os.pathsep.join(path))
     except IOError:
         return None