1

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

Kenly
  • 24,317
  • 7
  • 44
  • 60
E. Zahra
  • 87
  • 1
  • 16

2 Answers2

3

./library folder should contain at least one module, a directory with __init__.py file, and a manifest file (__manifest__.py or _openerp__.py) at top level as indicated in the module structure section

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

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  
Kenly
  • 24,317
  • 7
  • 44
  • 60
-1

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

E. Zahra
  • 87
  • 1
  • 16