Se rendre au contenu
Odoo Menu
  • Se connecter
  • Essai gratuit
  • Applications
    Finance
    • Comptabilité
    • Facturation
    • Notes de frais
    • Feuilles de calcul (BI)
    • Documents
    • Signature
    Ventes
    • CRM
    • Ventes
    • PdV Boutique
    • PdV Restaurant
    • Abonnements
    • Location
    Sites web
    • Site Web
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Chaîne d'approvisionnement
    • Inventaire
    • Fabrication
    • PLM
    • Achats
    • Maintenance
    • Qualité
    Ressources Humaines
    • Employés
    • Recrutement
    • Congés
    • Évaluations
    • Recommandations
    • Parc automobile
    Marketing
    • Marketing Social
    • E-mail Marketing
    • SMS Marketing
    • Événements
    • Marketing Automation
    • Sondages
    Services
    • Projet
    • Feuilles de temps
    • Services sur Site
    • Assistance
    • Planification
    • Rendez-vous
    Productivité
    • Discussion
    • Validations
    • Internet des Objets
    • VoIP
    • Connaissances
    • WhatsApp
    Applications tierces Odoo Studio Plateforme Cloud d'Odoo
  • Industries
    Commerce de détail
    • Librairie
    • Magasin de vêtements
    • Magasin de meubles
    • Épicerie
    • Quincaillerie
    • Magasin de jouets
    Food & Hospitality
    • Bar et Pub
    • Restaurant
    • Fast-food
    • Maison d’hôtes
    • Distributeur de boissons
    • Hôtel
    Immobilier
    • Agence immobilière
    • Cabinet d'architecture
    • Construction
    • Gestion immobilière
    • Jardinage
    • Association de copropriétaires
    Consultance
    • Cabinet d'expertise comptable
    • Partenaire Odoo
    • Agence Marketing
    • Cabinet d'avocats
    • Aquisition de talents
    • Audit & Certification
    Fabrication
    • Textile
    • Métal
    • Meubles
    • Alimentation
    • Brewery
    • Cadeaux d'entreprise
    Santé & Fitness
    • Club de sports
    • Opticien
    • Salle de fitness
    • Praticiens bien-être
    • Pharmacie
    • Salon de coiffure
    Trades
    • Bricoleur
    • Matériel informatique et support
    • Systèmes photovoltaïques
    • Cordonnier
    • Services de nettoyage
    • Services CVC
    Autres
    • Organisation à but non lucratif
    • Agence environnementale
    • Location de panneaux d'affichage
    • Photographie
    • Leasing de vélos
    • Revendeur de logiciel
    Browse all Industries
  • Communauté
    Apprenez
    • Tutoriels
    • Documentation
    • Certifications
    • Formation
    • Blog
    • Podcast
    Renforcer l'éducation
    • Programme éducatif
    • Business Game Scale-Up!
    • Rendez-nous visite
    Obtenir le logiciel
    • Téléchargement
    • Comparez les éditions
    • Versions
    Collaborer
    • Github
    • Forum
    • Événements
    • Traductions
    • Devenez partenaire
    • Services for Partners
    • Enregistrer votre cabinet comptable
    Nos Services
    • Trouver un partenaire
    • Trouver un comptable
    • Rencontrer un conseiller
    • Services de mise en œuvre
    • Références clients
    • Assistance
    • Mises à niveau
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Obtenir une démonstration
  • Tarification
  • Aide

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

  • CRM
  • e-Commerce
  • Comptabilité
  • Inventaire
  • PoS
  • Projet
  • MRP
All apps
Vous devez être inscrit pour interagir avec la communauté.
Toutes les publications Personnes Badges
Étiquettes (Voir toutl)
odoo accounting v14 pos v15
À propos de ce forum
Vous devez être inscrit pour interagir avec la communauté.
Toutes les publications Personnes Badges
Étiquettes (Voir toutl)
odoo accounting v14 pos v15
À propos de ce forum
Aide

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

S'inscrire

Recevez une notification lorsqu'il y a de l'activité sur ce poste

Cette question a été signalée
debuggingDocker
2 Réponses
21406 Vues
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
Ignorer
ti-sq

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

Avatar
Khaled
Meilleure réponse

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
Ignorer
Vous appréciez la discussion ? Ne vous contentez pas de lire, rejoignez-nous !

Créez un compte dès aujourd'hui pour profiter de fonctionnalités exclusives et échanger avec notre formidable communauté !

S'inscrire
Publications associées Réponses Vues Activité
how to Install odoo 15 with docker? Résolu
Docker
Avatar
Avatar
Avatar
Avatar
Avatar
4
déc. 23
47647
where is the POS Odoo logo located on Odoo installed on Docker? - Odoo 16 Community version
Docker
Avatar
Avatar
1
janv. 23
4480
How to setup odoo project using Odoo doodba ?
Docker
Avatar
Avatar
1
mars 24
7670
Docker Odoo
Docker
Avatar
1
févr. 21
3432
Odoo on Docker: how to change environment variables
Docker
Avatar
0
déc. 20
5751
Communauté
  • Tutoriels
  • Documentation
  • Forum
Open Source
  • Téléchargement
  • Github
  • Runbot
  • Traductions
Services
  • Hébergement Odoo.sh
  • Assistance
  • Migration
  • Développements personnalisés
  • Éducation
  • Trouver un comptable
  • Trouver un partenaire
  • Devenez partenaire
À propos
  • Notre société
  • Actifs de la marque
  • Contactez-nous
  • Emplois
  • Événements
  • Podcast
  • Blog
  • Clients
  • Informations légales • Confidentialité
  • Sécurité.
الْعَرَبيّة 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 est une suite d'applications open source couvrant tous les besoins de votre entreprise : CRM, eCommerce, Comptabilité, Inventaire, Point de Vente, Gestion de Projet, etc.

Le positionnement unique d'Odoo est d'être à la fois très facile à utiliser et totalement intégré.

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