This question has been flagged
2 Replies
14306 Views

the git repositories of the OCA (https://github.com/OCA/hr for example) are contain always a bunch of modules, so if you clone them with git you get a folder with subfolders.

The 'addons_path' in your config file can not handle such a 2-level structure, so if you clone into the 'addons' folder Odoo will not find these modules. Is there any common practise how to organize that best?

Just adding level-1 folders in /opt/ocb/ocb-server for each batch of modules and then extending the addons path seems a little cluttered, isn't it?

Avatar
Discard
Best Answer

Hi Gunnar,

try the following command:

sudo git clone https://github.com/odoo/<<insert OCA repo here>> /opt/odoo/custom/addons/

Then add the custom folder to the odoo-server.conf or openerp-server.conf file (eg. /etc/odoo-server.conf) on the addons_path line. You can continue adding custom module directories in this manner by seperating them with a comma.
addons_path = /opt/odoo/odoo-server/addons,/opt/odoo/custom/addons

 

Avatar
Discard

I think he doesn't want to add too many addons path folders and find a way to clone several repositories in just one addons folder. I am interesting in this information too. Does anyone know if we can do this?

Author

@Luke: it isn't that simple because you will not clone one single Module with the command you suggest but a batch of Modules inside of a higer-level folder. Like this you have ~/custom/addons/folder/Module1, Module2, Module2, ... etc. so you would have to add ~/custom/addons/folder/Module1,~custom/addons/folder/Module2,~/custom/addons/folder/Module3,...etc That gives a lot of entries ..... I wonder it the OCA people have a suggestion how to handle this most efficiently. Maybe they didn;t think that through and leave it to any user to decide how to manage that ...

Author

@Luke: it isn't that simple because you will not clone one single Module with the command you suggest but a batch of Modules inside of a higer-level folder. Like this you have ~/custom/addons/folder/Module1, Module2, Module2, ... etc. so you would have to add ~/custom/addons/folder/Module1,~custom/addons/folder/Module2,~/custom/addons/folder/Module3,...etc That gives a lot of entries ..... I wonder if the OCA people have a suggestion how to handle this most efficiently. Maybe they didn;t think that through and leave it to any user to decide how to manage that ...

Best Answer

Are you try to make some symbolic link ?

I have module in both place :

/opt/openerp/custom/addons_dev/

/opt/openerp/custom/addons/

 

and in my addons_path=/opt/openerp/server/addons,/opt/openerp/addons(here is where i made all the symbolic link)

and I have done

cd /opt/openerp/addons

and

ln -s /opt/openerp/custom/addons/* .

and

ln -s /opt/openerp/custorm/addons_dev/{module_1, module_2} .

With this I have only one folder with link to desired module, and I add or remove them easily(after uninstall them from odoo).

 

Hope this help.

Avatar
Discard
Author

so then the folder /opt/openerp/custorm/addons_dev is where you git clone into right? Do you list the symlinks in your 'official' addons folder in a .gitignore file, so when you update (git merge ...) your installation those will be ignored?

Author

ok, the symlinks work fine. I think that's an elegant way to work make an external modules folder like /opt/ocb/ocb-server/addons-clone and add symlinks as discribed in the "official" addons folder. When making a update modules list from inside you OpenERP/Odoo via the browser of your choice (firefox most likely) OpenERP finds the linked addons as well