Skip to Content
Odoo Menu
  • Prihlásiť sa
  • Vyskúšajte zadarmo
  • Aplikácie
    Financie
    • Účtovníctvo
    • Fakturácia
    • Výdavky
    • Tabuľka (BI)
    • Dokumenty
    • Podpis
    Predaj
    • CRM
    • Predaj
    • POS Shop
    • POS Restaurant
    • Manažment odberu
    • Požičovňa
    Webstránky
    • Tvorca webstránok
    • eShop
    • Blog
    • Fórum
    • Živý chat
    • eLearning
    Supply Chain
    • Sklad
    • Výroba
    • Správa životného cyklu produktu
    • Nákup
    • Údržba
    • Manažment kvality
    Ľudské zdroje
    • Zamestnanci
    • Nábor zamestnancov
    • Voľné dni
    • Hodnotenia
    • Odporúčania
    • Vozový park
    Marketing
    • Marketing sociálnych sietí
    • Email marketing
    • SMS marketing
    • Eventy
    • Marketingová automatizácia
    • Prieskumy
    Služby
    • Projektové riadenie
    • Pracovné výkazy
    • Práca v teréne
    • Helpdesk
    • Plánovanie
    • Schôdzky
    Produktivita
    • Tímová komunikácia
    • Schvalovania
    • IoT
    • VoIP
    • Znalosti
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Priemyselné odvetvia
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Reštaurácia
    • Fast Food
    • Guest House
    • Beverage distributor
    • Hotel
    Reality
    • Real Estate Agency
    • Architecture Firm
    • Konštrukcia
    • Estate Managament
    • Gardening
    • Property Owner Association
    Poradenstvo
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Výroba
    • Textile
    • Metal
    • Furnitures
    • Jedlo
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware and Support
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Iní
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all Industries
  • Komunita
    Vzdelávanie
    • Tutoriály
    • Dokumentácia
    • Certifikácie
    • Školenie
    • Blog
    • Podcast
    Empower Education
    • Vzdelávací program
    • Scale Up! Business Game
    • Visit Odoo
    Softvér
    • Stiahnuť
    • Porovnanie Community a Enterprise vierzie
    • Releases
    Spolupráca
    • Github
    • Fórum
    • Eventy
    • Preklady
    • Staň sa partnerom
    • Services for Partners
    • Register your Accounting Firm
    Služby
    • Nájdite partnera
    • Nájdite účtovníka
    • Meet an advisor
    • Implementation Services
    • Zákaznícke referencie
    • Podpora
    • Upgrades
    ​Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Získajte demo
  • Cenník
  • Pomoc

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

  • CRM
  • e-Commerce
  • Účtovníctvo
  • Sklady
  • PoS
  • Projektové riadenie
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Tagy (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Tagy (View all)
odoo accounting v14 pos v15
About this forum
Pomoc

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

Odoberať

Get notified when there's activity on this post

This question has been flagged
debuggingDocker
2 Replies
21364 Zobrazenia
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
Zrušiť
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
Zrušiť
Enjoying the discussion? Don't just read, join in!

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

Registrácia
Related Posts Replies Zobrazenia Aktivita
how to Install odoo 15 with docker? Solved
Docker
Avatar
Avatar
Avatar
Avatar
Avatar
4
dec 23
47615
where is the POS Odoo logo located on Odoo installed on Docker? - Odoo 16 Community version
Docker
Avatar
Avatar
1
jan 23
4455
How to setup odoo project using Odoo doodba ?
Docker
Avatar
Avatar
1
mar 24
7645
Docker Odoo
Docker
Avatar
1
feb 21
3403
Odoo on Docker: how to change environment variables
Docker
Avatar
0
dec 20
5730
Komunita
  • Tutoriály
  • Dokumentácia
  • Fórum
Open Source
  • Stiahnuť
  • Github
  • Runbot
  • Preklady
Služby
  • Odoo.sh hosting
  • Podpora
  • Vyššia verzia
  • Custom Developments
  • Vzdelávanie
  • Nájdite účtovníka
  • Nájdite partnera
  • Staň sa partnerom
O nás
  • Naša spoločnosť
  • Majetok značky
  • Kontaktujte nás
  • Pracovné ponuky
  • Eventy
  • Podcast
  • Blog
  • Zákazníci
  • Právne dokumenty • Súkromie
  • Bezpečnosť
الْعَرَبيّة 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 je sada podnikových aplikácií s otvoreným zdrojovým kódom, ktoré pokrývajú všetky potreby vašej spoločnosti: CRM, e-shop, účtovníctvo, skladové hospodárstvo, miesto predaja, projektový manažment atď.

Odoo prináša vysokú pridanú hodnotu v jednoduchom použití a súčasne plne integrovanými biznis aplikáciami.

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