Hi Roshan :
I I starting to work with pycharm but then I change to VS Code. I think is more friendly, specially when using dockers and python.
But in any case, the only thing that you need is to configure docker-compose.yml in a way that the addons and the pg_data folder make mounted outside the docker container. Then, you could configure pycharm to use the folder containing the addons, or the addon specifically you need.
Here is the docker-compose that I use. In my case, this configuration is practical, so if I need to work in another odoo version I just switch then in the file.
Hope it helps.
services:
db:
container_name: odoodb
hostname: odoo15db
image: postgres:12
environment:
- POSTGRES_USER=odoo15
- POSTGRES_PASSWORD=odoo15
- POSTGRES_DB=odoo15
- PGDATA = /var/lib/postgresql/data/pgdata
networks:
- odoonetwork
ports:
- "5432:5432"
volumes:
- ./data/pgdata:/var/lib/postgresql/data
web:
container_name: odooweb
image: odoo:15
build: .
depends_on:
- db
ports: - "8015:8015"
volumes:
- odoo-web-data:/var/lib/odoo
- ./config:/etc/odoo
- ./addons:/mnt/addons
- ./custom_addons:/mnt/custom_addons
- ./data/odoo:/var/lib/odoo
environment:
- VIRTUAL_HOST= www.odoo15.mac
command: "/usr/bin/odoo -c /etc/odoo/odoo.conf"
networks:
- odoonetwork
volumes:
odoo-db-data:
odoo-web-data:
networks:
odoonetwork:
driver: bridge