naveen
naveen

Reputation: 51

how to add a custom_folder to ""./odoo.py --addons=./addons"

Please let me know how to add a folder(eg:custom_module) to ""./odoo.py --addons=./addons" in odoo9

i am trying to add custom_module to """./odoo.py --addons=./addons". then getting below error

odoo.py: error: option --addons-path: The addons-path './custom_module' does not seem to a be a valid Addons Directory!

Upvotes: 2

Views: 11571

Answers (2)

Charif DZ
Charif DZ

Reputation: 14721

./odoo.py --addons-path=addons,full_path_of_you_new_addons

full path of the directory that contain the module not the path of the module it self like addons in odoo it's a directory contain all module directories

so you folder should be like this :

   -new_addons  : #full path of this folder
        ->you_module
              ->__openerp__.py
              ->__init__.py

NB: parameter for

 ./odoo.py  -r user_name -w password  --db_host=host_adress --addons-path=addons,new_addons,"new_addons",..  --update=module_name,module_name,...  --xmlrpc-port=8069

Upvotes: 2

Karim Reefat
Karim Reefat

Reputation: 61

There is two way to add custom folder to the odoo addons path:

First the easy one

to edit the configuration file of the odoo server and locate the line starting with addons_path and appending comma followed by the absolute path to the directory you want to add to the addons path,

so if the custom addons directory is /home/user_name/new-addons and the path of your odoo instance is /home/user_name/odoo the line should be like this

addons_path = /home/user_name/odoo/openerp/addons,/home/user_name/odoo/addons,/home/user_name/new-addons

The second

is when calling the odoo.py script and pass the --addons-path command line argument to it like this

$ odoo/odoo.py --addons-path="/home/user_name/odoo/openerp/addons, /home/user_name/odoo/addons, /home/user_name/new-addons"
  • in this case you must not only pass the path to your custom addons directory but also the paths of the base addons (odoo/openerp/addons) and the core addons directory (odoo/addons) and if your put space after the commas between the paths you will need to quote the list of directories.
  • here you can use relative paths but it is relative to the place where you call the odoo.py file .
  • if you use the second way the custom addons directory has to have at least one working module in it or any directory with init.py and openerp.py files inside it or it will give you "does not seem to a be a valid Addons Directory" error

see section : Configuring the addons path in the "Odoo Development Cookbook" book

Upvotes: 5

Related Questions