Multiple directories in addons-path

Asked by Jim Norman

At present, the addons-path seems to be limited to one directory, and one must link additional modules into the existing addons directory. Is it possible to list multiple directories in --addons-path such as --addons-path = [/opt/openerp/5.0/addons, /opt/openerp/my-addons] ???

If not, could this be added to the 6.0 trunk version?

Thank you for your consideration.

Question information

Language:
English Edit question
Status:
Solved
For:
Odoo Server (MOVED TO GITHUB) Edit question
Assignee:
No assignee Edit question
Solved by:
Jim Norman
Solved:
Last query:
Last reply:

This question was reopened

Revision history for this message
Christophe CHAUVET (christophe-chauvet) said :
#1

HI

This functionnality is available in trunk since 6 month, use
addons_path=/first/path/,/second/path

Regards,

Revision history for this message
Jim Norman (jim-jsnorman) said :
#2

WOW - that was quick - I'll check it out. Is the ending / required on the first entry? If so, it it required on only the first entry, or all but the last entry?

Thank you again!!

Revision history for this message
Jim Norman (jim-jsnorman) said :
#3

Thanks Christophe Chauvet - http://www.syleam.fr/, that solved my question.

Revision history for this message
Jim Norman (jim-jsnorman) said :
#4

Sorry, but I just received the following error while running "Update Modules List":

Environment Information :
System : Linux-2.6.31-20-generic-i686-with-Ubuntu-9.10-karmic
OS Name : posix
Distributor ID: Ubuntu
Description: Ubuntu 9.10
Release: 9.10
Codename: karmic
Operating System Release : 2.6.31-20-generic
Operating System Version : #58-Ubuntu SMP Fri Mar 12 05:23:09 UTC 2010
Operating System Architecture : 32bit
Operating System Locale : en_US.UTF8
Python Version : 2.6.4
OpenERP-Client Version : 5.0.9
Last revision No. & ID :1068 <email address hidden>
Traceback (most recent call last):
  File "/opt/openerp/5.0/server/bin/netsvc.py", line 245, in dispatch
    result = LocalService(service_name)(method, *params)
  File "/opt/openerp/5.0/server/bin/netsvc.py", line 74, in __call__
    return getattr(self, method)(*params)
  File "/opt/openerp/5.0/server/bin/service/web_services.py", line 632, in execute
    return self._execute(db, uid, wiz_id, datas, action, context)
  File "/opt/openerp/5.0/server/bin/service/web_services.py", line 612, in _execute
    return wiz.execute(db, uid, self.wiz_datas[wiz_id], action, context)
  File "/opt/openerp/5.0/server/bin/wizard/__init__.py", line 178, in execute
    res = self.execute_cr(cr, uid, data, state, context)
  File "/opt/openerp/5.0/server/bin/wizard/__init__.py", line 73, in execute_cr
    action_res = action(self, cr, uid, data, context)
  File "/opt/openerp/5.0/server/bin/addons/base/module/wizard/wizard_update_module.py", line 50, in _update_module
    update, add = pooler.get_pool(cr.dbname).get('ir.module.module').update_list(cr, uid)
  File "/opt/openerp/5.0/server/bin/addons/base/module/module.py", line 308, in update_list
    for mod_name in addons.get_modules():
  File "/opt/openerp/5.0/server/bin/addons/__init__.py", line 286, in get_modules
    return list(set(listdir(ad) + listdir(_ad)))
  File "/opt/openerp/5.0/server/bin/addons/__init__.py", line 284, in listdir
    return map(clean, filter(is_really_module, os.listdir(dir)))
OSError: [Errno 2] No such file or directory: '/opt/openerp/5.0/addons,/opt/openerp/5.0/addons-extra,/opt/openerp/5.0/addons-community'

Revision history for this message
Christophe CHAUVET (christophe-chauvet) said :
#5

Have you read my previous answer ?

It's only available in 6.0

Regards,

Revision history for this message
Jim Norman (jim-jsnorman) said :
#6

Thanks Christophe Chauvet - http://www.syleam.fr/, that solved my question.

Revision history for this message
Jim Norman (jim-jsnorman) said :
#7

I understand that it's only available in 6.0. I'm unable to get trunk to run, so I copied server/bin/addons/__init__.py from trunk to 5.0 and ran it. I made .openerp_serverrc show addons, addons-extra, and addons-community in the addons path. After running "Update Modules List" there were no modules added from addons-extra or addons-community. The module count remained 117 and no modules from the additional directories show in the Module List. I did verify that the directories are included in addons_path in __init__.py and list(set(plist)) shows all modules from all directories.

Thanks for your forbearance. I just want to verify that it's been tested for 6.0.

Jim Norman

Revision history for this message
Christophe CHAUVET (christophe-chauvet) said :
#8

There are a lot of changes in 6.0, you cannot replace only the __init__.py file

I use it with 6.0 since several month and it works

Regards,

Revision history for this message
Jim Norman (jim-jsnorman) said :
#9

Thank you for your information. If you're satisfied with it, I am too.

Revision history for this message
SG E-ndicus(Selvam) (e-ndicus) said :
#10

Hi,

I am using 6.0.2 version, I could not use multiple paths.

I tried,
openerp-server --addons-path=/usr/local/lib/python2.6/dist-packages/openerp-server/addons/,OTHER_PATH.
I am getting "error: option --addons-path: no such directory".