Skip to Content
Odoo Menú
  • Registra entrada
  • Prova-ho gratis
  • Aplicacions
    Finances
    • Comptabilitat
    • Facturació
    • Despeses
    • Full de càlcul (IA)
    • Documents
    • Signatura
    Vendes
    • CRM
    • Vendes
    • Punt de venda per a botigues
    • Punt de venda per a restaurants
    • Subscripcions
    • Lloguer
    Imatges de llocs web
    • Creació de llocs web
    • Comerç electrònic
    • Blog
    • Fòrum
    • Xat en directe
    • Aprenentatge en línia
    Cadena de subministrament
    • Inventari
    • Fabricació
    • PLM
    • Compres
    • Manteniment
    • Qualitat
    Recursos humans
    • Empleats
    • Reclutament
    • Absències
    • Avaluacions
    • Recomanacions
    • Flota
    Màrqueting
    • Màrqueting Social
    • Màrqueting per correu electrònic
    • Màrqueting per SMS
    • Esdeveniments
    • Automatització del màrqueting
    • Enquestes
    Serveis
    • Projectes
    • Fulls d'hores
    • Servei de camp
    • Suport
    • Planificació
    • Cites
    Productivitat
    • Converses
    • Validacions
    • IoT
    • VoIP
    • Coneixements
    • WhatsApp
    Aplicacions de tercers Odoo Studio Plataforma d'Odoo al núvol
  • Sectors
    Comerç al detall
    • Llibreria
    • Botiga de roba
    • Botiga de mobles
    • Botiga d'ultramarins
    • Ferreteria
    • Botiga de joguines
    Food & Hospitality
    • Bar i pub
    • Restaurant
    • Menjar ràpid
    • Guest House
    • Distribuïdor de begudes
    • Hotel
    Immobiliari
    • Agència immobiliària
    • Estudi d'arquitectura
    • Construcció
    • Gestió immobiliària
    • Jardineria
    • Associació de propietaris de béns immobles
    Consultoria
    • Empresa comptable
    • Partner d'Odoo
    • Agència de màrqueting
    • Bufet d'advocats
    • Captació de talent
    • Auditoria i certificació
    Fabricació
    • Textile
    • Metal
    • Mobles
    • Menjar
    • Brewery
    • Regals corporatius
    Salut i fitness
    • Club d'esport
    • Òptica
    • Centre de fitness
    • Especialistes en benestar
    • Farmàcia
    • Perruqueria
    Trades
    • Servei de manteniment
    • Hardware i suport informàtic
    • Sistemes d'energia solar
    • Shoe Maker
    • Serveis de neteja
    • Instal·lacions HVAC
    Altres
    • Nonprofit Organization
    • Agència del medi ambient
    • Lloguer de panells publicitaris
    • Fotografia
    • Lloguer de bicicletes
    • Distribuïdors de programari
    Browse all Industries
  • Comunitat
    Aprèn
    • Tutorials
    • Documentació
    • Certificacions
    • Formació
    • Blog
    • Pòdcast
    Potenciar l'educació
    • Programa educatiu
    • Scale-Up! El joc empresarial
    • Visita Odoo
    Obtindre el programari
    • Descarregar
    • Comparar edicions
    • Novetats de les versions
    Col·laborar
    • GitHub
    • Fòrum
    • Esdeveniments
    • Traduccions
    • Converteix-te en partner
    • Services for Partners
    • Registra la teva empresa comptable
    Obtindre els serveis
    • Troba un partner
    • Troba un comptable
    • Contacta amb un expert
    • Serveis d'implementació
    • Referències del client
    • Suport
    • Actualitzacions
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Programar una demo
  • Preus
  • Ajuda

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Comptabilitat
  • Inventari
  • PoS
  • Projectes
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Etiquetes (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Etiquetes (View all)
odoo accounting v14 pos v15
About this forum
Ajuda

Debug Odoo source code using Docker and Visual Studio Code on Windows

Subscriure's

Get notified when there's activity on this post

This question has been flagged
debuggingDocker
2 Respostes
21307 Vistes
Avatar
Cassio Nunes

Hi there!

I ´m developing a custom module on my local machine. I am using Docker Odoo Container and Visual Studio Code . So, guys... How to debug the Odoo code (Custom Module Code and Main Source Code) using Docker and Vistual Studio Code? I got part of the solution but looks like is missing something.

I did some changes on my launch.json, dockerfile and docker-compose files. So... I don´t know what to do now..

---------------------

My dockerfile:

 FROM debian:stretch

LABEL maintainer="Odoo S.A. <info@odoo.com>"


# Generate locale C.UTF-8 for postgres and general locale data

ENV LANG C.UTF-8


# Install some deps, lessc and less-plugin-clean-css, and wkhtmltopdf

RUN set -x; \

        apt-get update \

        && apt-get install -y --no-install-recommends \

            ca-certificates \

            curl \

            dirmngr \

            fonts-noto-cjk \

            gnupg \

            libssl1.0-dev \

            node-less \

            pkg-config \

            python3-pip \

            python3-pyldap \

            python3-qrcode \

            python3-renderpm \

            python3-setuptools \

            python3-vobject \

            python3-watchdog \

            xz-utils \

            #libssl-dev \

            #libxml2-dev \

            #libxmlsec1-dev \

        && curl -o wkhtmltox.deb -sSL https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox_0.12.5-1.stretch_amd64.deb \

        && echo '7e35a63f9db14f93ec7feeb0fce76b30c08f2057 wkhtmltox.deb' | sha1sum -c - \

        && dpkg --force-depends -i wkhtmltox.deb\

        && apt-get -y install -f --no-install-recommends \

        && rm -rf /var/lib/apt/lists/* wkhtmltox.deb


# install latest postgresql-client

RUN set -x; \

        echo 'deb http://apt.postgresql.org/pub/repos/apt/ stretch-pgdg main' > etc/apt/sources.list.d/pgdg.list \

        && export GNUPGHOME="$(mktemp -d)" \

        && repokey='B97B0AFCAA1A47F044F244A07FCC7D46ACCC4CF8' \

        && gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "${repokey}" \

        && gpg --armor --export "${repokey}" | apt-key add - \

        && gpgconf --kill all \

        && rm -rf "$GNUPGHOME" \

        && apt-get update  \

        && apt-get install -y postgresql-client \

        && rm -rf /var/lib/apt/lists/*


# Install rtlcss (on Debian stretch)

RUN set -x;\

    echo "deb http://deb.nodesource.com/node_8.x stretch main" > /etc/apt/sources.list.d/nodesource.list \

    && export GNUPGHOME="$(mktemp -d)" \

    && repokey='9FD3B784BC1C6FC31A8A0A1C1655A0AB68576280' \

    && gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "${repokey}" \

    && gpg --armor --export "${repokey}" | apt-key add - \

    && gpgconf --kill all \

    && rm -rf "$GNUPGHOME" \

    && apt-get update \

    && apt-get install -y nodejs \

    && npm install -g rtlcss \

    && rm -rf /var/lib/apt/lists/*


# Install Odoo

ENV ODOO_VERSION 12.0

ARG ODOO_RELEASE=20190424

ARG ODOO_SHA=3885be6791b9b8c2a74115299e57213c71db4363

RUN set -x; \

        curl -o odoo.deb -sSL http://nightly.odoo.com/${ODOO_VERSION}/nightly/deb/odoo_${ODOO_VERSION}.${ODOO_RELEASE}_all.deb \

        && echo "${ODOO_SHA} odoo.deb" | sha1sum -c - \

        && dpkg --force-depends -i odoo.deb \

        && apt-get update \

        && apt-get -y install -f --no-install-recommends \

        && rm -rf /var/lib/apt/lists/* odoo.deb


# Copy entrypoint script and Odoo configuration file

RUN pip3 install num2words xlwt

COPY ./entrypoint.sh /

COPY ./config/odoo.conf /etc/odoo/

RUN chown odoo /etc/odoo/odoo.conf


# Mount /var/lib/odoo to allow restoring filestore and /mnt/extra-addons for users addons

RUN mkdir -p /mnt/extra-addons \

        && chown -R odoo /mnt/extra-addons

VOLUME ["/var/lib/odoo", "/mnt/extra-addons"]


#Install Brazil Location Depences


RUN pip3 install wheel

RUN pip3 install pillow==3.4.2

RUN pip3 install ofxparse==0.16

RUN pip3 install suds-jurko-requests

RUN pip3 install pytrustnfe3>=0.10.0

RUN pip3 install python3-cnab

RUN pip3 install python3-boleto

#RUN pip3 install xmlsec

#RUN pip3 install lxml==4.2.3

RUN pip3 install pycnab240


# Expose Odoo services - 5858 to debug

EXPOSE 8069 8071 5858


# Set the default config file

ENV ODOO_RC /etc/odoo/odoo.conf


# Set default user when running the container

USER odoo


ENTRYPOINT ["/entrypoint.sh"]

CMD ["odoo"]

--------------------------

My docker compose file: 

version: '3'
services:
web:
build:
context: .
dockerfile: Dockerfile-dev
image: odoo:12.0
depends_on:
- db
ports:
- "8069:8069"
- "5858:5858"
volumes:
- odoo-web-data:/var/lib/odoo
- ./config:/etc/odoo
- ./addons:/mnt/extra-addons
db:
image: postgres:10
environment:
- POSTGRES_DB=postgres
- POSTGRES_PASSWORD=odoo
- POSTGRES_USER=odoo
- PGDATA=/var/lib/postgresql/data/pgdata
volumes:
- odoo-db-data:/var/lib/postgresql/data/pgdata

volumes:
odoo-web-data:
odoo-db-data:
0
Avatar
Descartar
ti-sq

Did you work it out? I have the same problem.

Avatar
Khaled
Best Answer

Well, I guess there is better way that there is no need to add code to odoo itself

https://gist.github.com/kerbrose/e646aaf9daece42b46091e2ca0eb55d0

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Odoo: Attach",
            "type": "python",
            "request": "attach",
            "port": 8879,
            "debugServer": 8888,
            "host": "localhost",
            "pathMappings": [
                {
                    "localRoot": "${workspaceFolder}",
                    "remoteRoot": "/mnt/extra-addons", //path to custom addons inside docker
                },
                {
                    "localRoot": "/dev/odoo", //odoo source code
                    "remoteRoot": "/odoo",    //path to source inside docker
                }
            ],
            "logToFile": true
            //"preLaunchTask": "init docker",
            //"postDebugTask": "stop docker"
        }
    ]
}

please note that your docker.dev file should include

RUN pip3 install -U debugpy

then you will be running the debugger not odoo as
docker run --rm -p 8888:3001 -p 8879:8069 odoo /usr/bin/python3 -m debugpy --listen 0.0.0.0:3001 /usr/bin/odoo --db_user=odoo --db_host=db --db_password=odoo
or
docker-compose run --rm -p 8888:3001 -p 8879:8069 odoo /usr/bin/python3 -m debugpy --listen 0.0.0.0:3001 /usr/bin/odoo --db_user=odoo --db_host=db --db_password=odoo
0
Avatar
Descartar
Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Registrar-se
Related Posts Respostes Vistes Activitat
how to Install odoo 15 with docker? Solved
Docker
Avatar
Avatar
Avatar
Avatar
Avatar
4
de des. 23
47571
where is the POS Odoo logo located on Odoo installed on Docker? - Odoo 16 Community version
Docker
Avatar
Avatar
1
de gen. 23
4419
How to setup odoo project using Odoo doodba ?
Docker
Avatar
Avatar
1
de març 24
7610
Docker Odoo
Docker
Avatar
1
de febr. 21
3384
Odoo on Docker: how to change environment variables
Docker
Avatar
0
de des. 20
5708
Community
  • Tutorials
  • Documentació
  • Fòrum
Codi obert
  • Descarregar
  • GitHub
  • Runbot
  • Traduccions
Serveis
  • Allotjament a Odoo.sh
  • Suport
  • Actualització
  • Desenvolupaments personalitzats
  • Educació
  • Troba un comptable
  • Troba un partner
  • Converteix-te en partner
Sobre nosaltres
  • La nostra empresa
  • Actius de marca
  • Contacta amb nosaltres
  • Llocs de treball
  • Esdeveniments
  • Pòdcast
  • Blog
  • Clients
  • Informació legal • Privacitat
  • Seguretat
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo és un conjunt d'aplicacions empresarials de codi obert que cobreix totes les necessitats de la teva empresa: CRM, comerç electrònic, comptabilitat, inventari, punt de venda, gestió de projectes, etc.

La proposta única de valor d'Odoo és ser molt fàcil d'utilitzar i estar totalment integrat, ambdues alhora.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now