path is not a valid addons directory

Viewed 32

Hello

following steps in "ODOO 15 DEVELOPMENT ESSENTIALS FIFTH EDITION" im trying to add custom addons folder using terminal on ubuntu (wsl), when i run this command:

$ odoo -d 15-library --addons-path="./library,./odoo/addons"

i get this error:

Usage: odoo [options]

odoo: error: option --addons-path: the path './library' is not a valid addons directory

btw folder library exists in my path

thanks in advance for any help

2 Answers

Odoo will call the _check_addons_path function when you pass --addons-path in command line and check if all folders are valid addons paths

./library folder should contain at least one module, a directory with __init__.py file, and a manifest file (__manifest__.py or _openerp__.py)

def _is_addons_path(self, path):
    from odoo.modules.module import MANIFEST_NAMES
    for f in os.listdir(path):
        modpath = os.path.join(path, f)
        if os.path.isdir(modpath):
            def hasfile(filename):
                return os.path.isfile(os.path.join(modpath, filename))
            if hasfile('__init__.py') and any(hasfile(mname) for mname in MANIFEST_NAMES):
                return True
    return False  

It is solved by running scaffold command in the directory before running the command in the question .

Related