Skip to Content
Menú
This question has been flagged
2 Respostes
2079 Vistes

I am an intern at a company and we are using modules from other companies, such as OCA in our system. However, we would like to have a separate folder that works like the addons folder but with the name of the company from which we are using the modules so that it is more organized and facilitates the management of imports. However, for this to work, we need to put the full path to the folder module inside the addons_path in odoo.conf, for example: /home/user/odoo/oca/web. However, this way the file needs to have the path to each module, which makes the file very large and we need to edit it every time we add a new module. Does anyone have a way to just put the path to the oca folder, for example: /home/user/odoo/oca in the addons_path, and it already leaves all the modules cloned inside it to be installed in odoo?


odoo 16.0

Avatar
Descartar
Best Answer

Hello Gabriel Sellan,

I hope you're doing well.


I have shared 3 steps you can use.


Step : 1 Using a simple path.

odoo@odoo ~/workspace/16comminity (16.0) $  ./odoo-bin --addons-path=addons -p 1704 -d test_16


Step : 2 Using a simple path + Add another module path.

odoo@odoo ~/workspace/16comminity (16.0) $  ./odoo-bin --addons-path=addons,/home/odoo/Downloads/report_qweb_element_page_visibility-16.0.1.0.0/ -p 1601 -d db_test_16


Step : 3 Using config file.

odoo@odoo ~/workspace/16comminity (16.0) $ ./odoo-bin -c /home/odoo/workspace/16/Conf/odoo_16.cfg -p 1601 -d test_16


Inside the config : 

addons_path = /home/odoo/workspace/16comminity/addons,/home/odoo/workspace/16enteprice,/home/odoo/Downloads/report_qweb_element_page_visibility-16.0.1.0.0/


Hope this helps!


Thanks & Regards,

Name : Yahoo Baba

Email:  yahoobaba077@gmail.com

Avatar
Descartar
Best Answer

To manage modules efficiently and keep your odoo.conf file manageable, you can configure Odoo to recognize a parent directory and automatically find modules within it. Here's how to set it up in Odoo 16.0:

1. Organize Your Directory Structure

  1. Create a Directory:
    • Create a parent directory where you will store all your external modules, e.g., /home/user/odoo/oca.
  2. Place Your Modules:
    • Inside this parent directory (oca), you can place all the module folders.

2. Configure Odoo to Use the Parent Directory

  1. Edit odoo.conf:
    • Open the Odoo configuration file (odoo.conf) with a text editor.
  2. Set the addons_path:
    • Modify the addons_path parameter to point to the parent directory. Odoo will then recursively search for modules within this directory and its subdirectories.
    • Example configuration:
      iniCopy codeaddons_path = /home/user/odoo/oca
      
    • This setting tells Odoo to look inside /home/user/odoo/oca and any subdirectories within it to find modules.

3. Ensure Proper Permissions

  • Make sure that the Odoo process has the necessary read permissions for the new directory and its subdirectories.

4. Restart Odoo

  • Restart the Odoo server to apply the changes. Depending on your setup, you might use:
    bashCopy codesudo systemctl restart odoo
    
    or if running manually:
    bashCopy code./odoo-bin -c /path/to/your/odoo.conf
    

5. Update the Apps List

  • Log in to your Odoo instance.
  • Go to the Apps menu and click on Update Apps List to ensure that Odoo detects and lists the modules from the new directory.

Advantages of This Approach:

  • Simplified Management: You only need to specify the path to the parent directory, making the odoo.conf file cleaner and easier to manage.
  • Automatic Detection: Odoo will automatically detect any new modules added to the subdirectories, reducing the need for constant manual updates.

By configuring the addons_path to point to a parent directory, you streamline the process of managing and organizing external modules. This setup will keep your configuration file concise and make module management more efficient.

Avatar
Descartar