skip to Main Content

Hello

following the steps in "ODOO 15 DEVELOPMENT ESSENTIALS FIFTH EDITION" I’m trying to add a custom addons folder using a 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


  1. Chosen as BEST ANSWER

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


  2. 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  
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search