Home > Software engineering >  How do i acces odoo files (such as installed addons folder)?
How do i acces odoo files (such as installed addons folder)?

Time:10-07

I've set up Odoo 15 on a container with docker compose, and am accessing the container through "remote container" extension on VS code, i've looked everywhere i cant seem to get how to access the odoo files such as the installed addons folder

 i've set up my volumes in docker-compose file pretty much in this way 

version: '3' services: odoo:
image: odoo:15.0
env_file: .env
depends_on: - postgres
ports:
- "127.0.0.1:8069:8069"
volumes:
- data:/var/lib/odoo
- ./config:/etc/odoo
- ./extra-addons:/mnt/extra-addons

But since i would like to apply changes on the html/css of non custom addons that are already present in odoo i'd have to access the source code of odoo that is present in the container (if doable).

for example in the volume " odoo-addons:/mnt/extra-addons " would be a directory where i could add my custom module but what i want is to find the source code of the addons already present in Odoo ?!

CodePudding user response:

Use named volumes - it will copy the existing data from the container image into a new volume. In docker-compose you can do it, by defining a volume:

version: '2'

volumes:
  data:
  
services:
 odoo:
  image: odoo:15.0
  env_file: .env
  depends_on: 
   - postgres
  ports:
   - "127.0.0.1:8069:8069"
  volumes:
   - data:/var/lib/odoo
   - ./config:/etc/odoo
   - ./extra-addons:/mnt/extra-addons

If your files reside in the /var/lib/odoo folder you will be able to view/edit the files which are there by accessing them in the /var/lib/docker/volumes/{someName}_data/_data

CodePudding user response:

Thank you for the answer, well i just figured that the folder where I can find the source code folder is located in " /usr/lib/python3/dist-packages/odoo/ " in the container, it's my first time using odoo but apparently it's not really recomended to modify odoo directly in the source code, i'm trying to figure what's the "recomended" way to do so in a container, but i found at least a solution for the 1st issue ! Thanks a lot !

  • Related