Skip to Content
Odoo Menu
  • Prijavi
  • Try it free
  • Aplikacije
    Finance
    • Knjigovodstvo
    • Obračun
    • Stroški
    • Spreadsheet (BI)
    • Dokumenti
    • Podpisovanje
    Prodaja
    • CRM
    • Prodaja
    • POS Shop
    • POS Restaurant
    • Naročnine
    • Najem
    Spletne strani
    • Website Builder
    • Spletna trgovina
    • Blog
    • Forum
    • Pogovor v živo
    • eUčenje
    Dobavna veriga
    • Zaloga
    • Proizvodnja
    • PLM
    • Nabava
    • Vzdrževanje
    • Kakovost
    Kadri
    • Kadri
    • Kadrovanje
    • Odsotnost
    • Ocenjevanja
    • Priporočila
    • Vozni park
    Marketing
    • Družbeno Trženje
    • Email Marketing
    • SMS Marketing
    • Dogodki
    • Avtomatizacija trženja
    • Ankete
    Storitve
    • Projekt
    • Časovnice
    • Storitve na terenu
    • Služba za pomoč
    • Načrtovanje
    • Termini
    Produktivnost
    • Razprave
    • Odobritve
    • IoT
    • Voip
    • Znanje
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Industrije
    Trgovina na drobno
    • Book Store
    • Trgovina z oblačili
    • Trgovina s pohištvom
    • Grocery Store
    • Trgovina s strojno opremo računalnikov
    • Trgovina z igračami
    Food & Hospitality
    • Bar and Pub
    • Restavracija
    • Hitra hrana
    • Guest House
    • Beverage Distributor
    • Hotel
    Nepremičnine
    • Real Estate Agency
    • Arhitekturno podjetje
    • Gradbeništvo
    • Estate Management
    • Vrtnarjenje
    • Združenje lastnikov nepremičnin
    Svetovanje
    • Računovodsko podjetje
    • Odoo Partner
    • Marketinška agencija
    • Law firm
    • Pridobivanje talentov
    • Audit & Certification
    Proizvodnja
    • Tekstil
    • Metal
    • Pohištvo
    • Hrana
    • Brewery
    • Poslovna darila
    Health & Fitness
    • Športni klub
    • Trgovina z očali
    • Fitnes center
    • Wellness Practitioners
    • Lekarna
    • Frizerski salon
    Trades
    • Handyman
    • IT Hardware & Support
    • Sistemi sončne energije
    • Izdelovalec čevljev
    • Čistilne storitve
    • HVAC Services
    Ostali
    • Neprofitna organizacija
    • Agencija za okolje
    • Najem oglasnih panojev
    • Fotografija
    • Najem koles
    • Prodajalec programske opreme
    Browse all Industries
  • Skupnost
    Learn
    • Tutorials
    • Dokumentacija
    • Certifikati
    • Šolanje
    • Blog
    • Podcast
    Empower Education
    • Education Program
    • Scale Up! Business Game
    • Visit Odoo
    Get the Software
    • Prenesi
    • Compare Editions
    • Releases
    Collaborate
    • Github
    • Forum
    • Dogodki
    • Prevodi
    • Become a Partner
    • Services for Partners
    • Register your Accounting Firm
    Get Services
    • Find a Partner
    • Find an Accountant
    • Meet an advisor
    • Implementation Services
    • Sklici kupca
    • Podpora
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Get a demo
  • Določanje cen
  • Pomoč

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

  • CRM
  • e-Commerce
  • Knjigovodstvo
  • Zaloga
  • PoS
  • Projekt
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Ključne besede (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Ključne besede (View all)
odoo accounting v14 pos v15
About this forum
Pomoč

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

Naroči se

Get notified when there's activity on this post

This question has been flagged
debuggingDocker
2 Odgovori
21351 Prikazi
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
Opusti
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
Opusti
Enjoying the discussion? Don't just read, join in!

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

Prijavi
Related Posts Odgovori Prikazi Aktivnost
how to Install odoo 15 with docker? Solved
Docker
Avatar
Avatar
Avatar
Avatar
Avatar
4
dec. 23
47606
where is the POS Odoo logo located on Odoo installed on Docker? - Odoo 16 Community version
Docker
Avatar
Avatar
1
jan. 23
4452
How to setup odoo project using Odoo doodba ?
Docker
Avatar
Avatar
1
mar. 24
7640
Docker Odoo
Docker
Avatar
1
feb. 21
3401
Odoo on Docker: how to change environment variables
Docker
Avatar
0
dec. 20
5729
Community
  • Tutorials
  • Dokumentacija
  • Forum
Open Source
  • Prenesi
  • Github
  • Runbot
  • Prevodi
Services
  • Odoo.sh Hosting
  • Podpora
  • Nadgradnja
  • Custom Developments
  • Izobraževanje
  • Find an Accountant
  • Find a Partner
  • Become a Partner
About us
  • Our company
  • Sredstva blagovne znamke
  • Kontakt
  • Zaposlitve
  • Dogodki
  • Podcast
  • Blog
  • Stranke
  • Pravno • Zasebnost
  • Varnost
الْعَرَبيّة 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 is a suite of open source business apps that cover all your company needs: CRM, eCommerce, accounting, inventory, point of sale, project management, etc.

Odoo's unique value proposition is to be at the same time very easy to use and fully integrated.

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