├── .github └── workflows │ └── build.yaml ├── 14.0 ├── Dockerfile ├── MANIFEST.in ├── base_requirements.txt ├── extra_requirements.txt ├── src_requirements.txt ├── templates │ └── odoo.cfg.tmpl └── test_requirements.txt ├── 15.0 ├── Dockerfile ├── MANIFEST.in ├── base_requirements.txt ├── extra_requirements.txt ├── src_requirements.txt ├── templates │ └── odoo.cfg.tmpl └── test_requirements.txt ├── 16.0 ├── Dockerfile ├── MANIFEST.in ├── base_requirements.txt ├── extra_requirements.txt ├── src_requirements.txt ├── templates │ └── odoo.cfg.tmpl └── test_requirements.txt ├── 17.0 ├── Dockerfile ├── MANIFEST.in ├── base_requirements.txt ├── extra_requirements.txt ├── src_requirements.txt ├── templates │ └── odoo.cfg.tmpl └── test_requirements.txt ├── 18.0 ├── Dockerfile ├── MANIFEST.in ├── base_requirements.txt ├── extra_requirements.txt ├── src_requirements.txt ├── templates │ └── odoo.cfg.tmpl └── test_requirements.txt ├── HISTORY.rst ├── Makefile ├── README.md ├── before-migrate-entrypoint.d └── .gitkeep ├── bin ├── check_package ├── docker-entrypoint.sh ├── lint ├── list_dependencies.py ├── migrate ├── runmigration ├── runtests ├── testdb-gen ├── testdb-update └── wait_postgres.sh ├── build.sh ├── example ├── Dockerfile ├── README.md ├── data │ └── images │ │ └── logo.png ├── docker-compose.yml ├── migration.yml ├── odoo │ ├── .dockerignore │ ├── VERSION │ ├── addons │ │ ├── README.md │ │ └── dummy_test │ │ │ ├── __init__.py │ │ │ ├── __manifest__.py │ │ │ └── tests │ │ │ ├── __init__.py │ │ │ └── test_dummy.py │ ├── setup.py │ └── src │ │ └── README.md ├── pyproject.toml ├── requirements.txt ├── setup.py ├── songs │ ├── __init__.py │ └── install │ │ ├── __init__.py │ │ ├── base.py │ │ └── demo.py └── test-compose.yml ├── install ├── dev_package.sh ├── disable_dst_root_cert-jessie.sh ├── dockerize.sh ├── kwkhtml_client.sh ├── kwkhtml_client_force_python3.sh ├── package_odoo.sh ├── package_odoo_11.0_12.0.sh ├── postgres.sh ├── purge_dev_package_and_cache.sh ├── reportlab_init.sh └── setup-pip.sh ├── setup.sh ├── start-entrypoint.d ├── 000_set_base_url └── 001_set_report_url └── test.sh /.github/workflows/build.yaml: -------------------------------------------------------------------------------- 1 | name: build 2 | 3 | on: 4 | push: 5 | branches: 6 | - "main" 7 | - "master" 8 | - "dev" 9 | tags: 10 | - "*.*.*.*.*" 11 | - "stable" 12 | 13 | pull_request: 14 | branches: 15 | - "main" 16 | - "master" 17 | schedule: 18 | - cron: "0 1 * * THU" 19 | 20 | 21 | env: 22 | TARGET: GHCR 23 | DOCKER_BUILDKIT: 1 24 | COMPOSE_DOCKER_CLI_BUILD: 1 25 | 26 | jobs: 27 | 28 | build: 29 | runs-on: ubuntu-latest 30 | strategy: 31 | matrix: 32 | odoo_serie: ["14.0","15.0","16.0","17.0","18.0"] 33 | 34 | steps: 35 | - uses: actions/checkout@v4 36 | 37 | - name: Set up Docker Buildx 38 | id: buildx 39 | uses: docker/setup-buildx-action@v2 40 | with: 41 | driver: docker 42 | 43 | - name: Docker meta 44 | id: docker_meta 45 | uses: docker/metadata-action@v4 46 | with: 47 | images: ghcr.io/camptocamp/docker-odoo-project 48 | flavor: | 49 | prefix=${{ matrix.odoo_serie }}-,onlatest=true 50 | tags: | 51 | type=raw,value={{branch}}-latest 52 | type=raw,value={{branch}}-{{date 'YYYYMMDD'}} 53 | type=ref,event=tag 54 | type=ref,event=pr 55 | type=schedule,pattern={{branch}}-nightly 56 | type=raw,value={{branch}} 57 | 58 | - name: Setup build dir 59 | run: | 60 | VERSION=${{ matrix.odoo_serie }} SRC=build make setup 61 | 62 | - name: Build 63 | uses: docker/build-push-action@v3 64 | with: 65 | context: ./build 66 | push: false 67 | load: true 68 | tags: ci-5xx-latest:${{ matrix.odoo_serie }} 69 | labels: ${{ steps.docker_meta.outputs.labels }} 70 | 71 | - name: Test 72 | run: make VERSION=${{ matrix.odoo_serie }} test 73 | 74 | - name: Login to GitHub Container Registry 75 | if: github.event_name == 'push' || github.event_name == 'schedule' 76 | uses: docker/login-action@v2 77 | with: 78 | registry: ghcr.io 79 | username: ${{ secrets.GHCR_USER }} 80 | password: ${{ secrets.GHCR_TOKEN }} 81 | 82 | - name: Scan image 83 | id: scan 84 | uses: sysdiglabs/scan-action@v5 85 | with: 86 | sysdig-secure-url: https://eu1.app.sysdig.com 87 | stop-on-failed-policy-eval: false 88 | stop-on-processing-error: false 89 | image-tag: ci-5xx-latest:${{ matrix.odoo_serie }} 90 | skip-upload: false 91 | sysdig-secure-token: ${{ secrets.SYSDIG_SECURE_TOKEN }} 92 | 93 | 94 | - name: Tag & Push 95 | if: github.event_name == 'push' || github.event_name == 'schedule' 96 | id: docker_push 97 | uses: docker/build-push-action@v3 98 | with: 99 | context: ./build 100 | push: ${{ github.event_name != 'pull_request' }} 101 | tags: ${{ steps.docker_meta.outputs.tags }} 102 | labels: ${{ steps.docker_meta.outputs.labels }} 103 | 104 | - name: Image digest 105 | run: echo ${{ steps.docker_push.outputs.digest }} 106 | -------------------------------------------------------------------------------- /14.0/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM python:3.9-slim-bookworm 2 | ARG UID=999 3 | ARG GID=999 4 | # create the working directory and a place to set the logs (if wanted) 5 | RUN mkdir -p /odoo /var/log/odoo 6 | 7 | COPY ./install /install 8 | COPY ./base_requirements.txt /odoo 9 | COPY ./extra_requirements.txt /odoo 10 | COPY ./test_requirements.txt /odoo 11 | 12 | # Moved because there was a bug while installing `odoo-autodiscover`. There is 13 | # an accent in the contributor name 14 | ENV LANG=C.UTF-8 \ 15 | LC_ALL=C.UTF-8 16 | 17 | # build and dev packages 18 | ENV BUILD_PACKAGE \ 19 | build-essential \ 20 | gcc \ 21 | libevent-dev \ 22 | libfreetype6-dev \ 23 | libxml2-dev \ 24 | libxslt1-dev \ 25 | libsasl2-dev \ 26 | libldap2-dev \ 27 | libssl-dev \ 28 | libjpeg-dev \ 29 | libpng-dev \ 30 | zlib1g-dev \ 31 | libcairo2-dev 32 | 33 | 34 | 35 | # Install some deps, lessc and less-plugin-clean-css, and wkhtmltopdf 36 | # wkhtml-buster is kept as in official image, no deb available for bullseye 37 | RUN set -x; \ 38 | sh -c /install/package_odoo.sh \ 39 | && /install/setup-pip.sh \ 40 | && /install/postgres.sh \ 41 | && /install/kwkhtml_client.sh \ 42 | && /install/kwkhtml_client_force_python3.sh \ 43 | && /install/dev_package.sh 44 | 45 | # grab dockerize to generate template and 46 | # wait on postgres 47 | RUN /install/dockerize.sh 48 | 49 | COPY ./src_requirements.txt /odoo 50 | COPY ./bin /odoo/odoo-bin 51 | COPY ./templates /templates 52 | COPY ./before-migrate-entrypoint.d /odoo/before-migrate-entrypoint.d 53 | COPY ./start-entrypoint.d /odoo/start-entrypoint.d 54 | COPY ./MANIFEST.in /odoo 55 | 56 | RUN groupadd -g $GID odoo \ 57 | && adduser --disabled-password -u $UID --gid $GID --gecos '' odoo \ 58 | && touch /odoo/odoo.cfg \ 59 | && touch /odoo/.bashrc \ 60 | && mkdir -p /odoo/data/odoo/{addons,filestore,sessions} \ 61 | && chown -R odoo:root /odoo && usermod odoo --home /odoo \ 62 | && chown -R odoo:root /var/log/odoo 63 | 64 | VOLUME ["/data/odoo", "/var/log/odoo"] 65 | USER odoo 66 | RUN python3 -m venv /odoo/.venv --system-site-packages 67 | ENV PATH=/odoo/.venv/bin:$PATH 68 | ENV PYTHONPATH=$PYTHONPATH:/odoo/ 69 | RUN echo "export PATH=$PATH" >> ~/.bashrc 70 | 71 | RUN /odoo/.venv/bin/pip install -r /odoo/base_requirements.txt 72 | RUN /odoo/.venv/bin/pip install -r /odoo/extra_requirements.txt 73 | RUN /odoo/.venv/bin/pip install -r /odoo/test_requirements.txt 74 | USER root 75 | RUN set -x; \ 76 | sh -c /install/purge_dev_package_and_cache.sh 77 | RUN chgrp -R 0 /odoo && \ 78 | chmod -R g=u /odoo 79 | USER odoo 80 | EXPOSE 8069 8072 81 | 82 | ENV ODOO_VERSION=14.0 \ 83 | PATH=/odoo/odoo-bin:/odoo/.local/bin:$PATH \ 84 | LANG=C.UTF-8 \ 85 | LC_ALL=C.UTF-8 \ 86 | DB_HOST=db \ 87 | DB_PORT=5432 \ 88 | DB_NAME=odoodb \ 89 | DB_USER=odoo \ 90 | DB_PASSWORD=odoo \ 91 | ODOO_BASE_URL=http://localhost:8069 \ 92 | ODOO_REPORT_URL=http://localhost:8069 \ 93 | # the place where you put the data of your project (csv, ...) 94 | ODOO_DATA_PATH=/odoo/data \ 95 | DEMO=False \ 96 | ADDONS_PATH=/odoo/odoo/addons,/odoo/odoo/src/odoo/addons \ 97 | ODOO_RC=/odoo/odoo.cfg 98 | 99 | ENTRYPOINT ["docker-entrypoint.sh"] 100 | CMD ["odoo"] 101 | -------------------------------------------------------------------------------- /14.0/MANIFEST.in: -------------------------------------------------------------------------------- 1 | recursive-include odoo/data * 2 | -------------------------------------------------------------------------------- /14.0/base_requirements.txt: -------------------------------------------------------------------------------- 1 | # unused official dependencies are commented to avoid dependabot alerts 2 | Babel==2.11.0 3 | chardet==3.0.4 4 | decorator==4.3.0 5 | docutils==0.14 6 | ebaysdk==2.1.5 7 | freezegun==0.3.15; python_version >= '3.8' 8 | # gevent==1.1.2 ; sys_platform != 'win32' and python_version < '3.7' 9 | gevent==24.11.1 ; python_version >= '3.8' 10 | greenlet==3.1.1 ; python_version > '3.7' 11 | html2text==2018.1.9 12 | idna==2.6 13 | # bullseye version, focal patched 2.10 14 | Jinja2==3.1.6; python_version >= '3.8' # official 2.11.2 15 | libsass==0.17.0 16 | # lxml==3.7.1 ; sys_platform != 'win32' and python_version < '3.7' 17 | lxml_html_clean 18 | lxml==4.9.1 19 | # lxml ; sys_platform == 'win32' 20 | Mako==1.2.2 21 | MarkupSafe==2.1.5 22 | num2words==0.5.6 23 | ofxparse==0.19 24 | passlib==1.7.1 25 | # Pillow==6.1.0 ; python_version <= '3.7' and sys_platform == 'win32' 26 | Pillow==9.0.1 ; python_version > '3.7' # official 8.1.1 27 | polib==1.1.0 28 | psutil==5.6.6 29 | psycopg2==2.8.6; sys_platform == 'win32' or python_version >= '3.8' # official 2.8.5 30 | pydot==1.4.1 31 | python-ldap==3.1.0; sys_platform != 'win32' 32 | PyPDF2==1.26.0 33 | pyserial==3.4 34 | python-dateutil==2.7.3 35 | pytz==2024.1 36 | pyusb==1.0.2 37 | qrcode==6.1 38 | reportlab==3.6.9 39 | requests==2.25.1 # official 2.21.0 40 | zeep==3.2.0 41 | python-stdnum==1.13 # official 1.8 42 | vobject==0.9.6.1 43 | Werkzeug==2.0.2 44 | XlsxWriter==1.1.2 45 | xlwt==1.3.* 46 | xlrd==1.2.0; python_version >= '3.8' 47 | 48 | 49 | setuptools==73.0.1 50 | 51 | whool==1.2.0 52 | # Not part of official requirements, but used by some addons 53 | # colorama==0.3.9 54 | gdata==2.0.18 55 | html5lib==1.1 56 | odfpy==1.4.1 57 | pyinotify==0.9.6 58 | simplejson==3.19.3 59 | 60 | # Migration tools 61 | marabunta==0.12.0 62 | -e git+https://github.com/camptocamp/anthem@master#egg=anthem 63 | 64 | 65 | # Library dependency 66 | argh==0.31.3 67 | atomicwrites==1.4.1 68 | attrs==24.2.0 69 | beautifulsoup4==4.12.3 70 | future==1.0.0 71 | mccabe==0.7.0 72 | more-itertools==10.5.0 73 | pbr==6.1.0 74 | pexpect==4.9.0 75 | ptyprocess==0.7.0 76 | 77 | pycodestyle==2.12.1 78 | pyflakes==3.2.0 79 | unicodecsv==0.14.1 80 | wrapt==1.16.0 81 | -------------------------------------------------------------------------------- /14.0/extra_requirements.txt: -------------------------------------------------------------------------------- 1 | # Extra python dependencies 2 | algoliasearch==4.1.1 3 | Adyen==12.3.0 4 | cachetools==5.5.0 5 | cerberus==1.3.5 6 | boto3==1.35.6 7 | factur-x==3.1 8 | invoice2data==0.4.5 9 | mailjet-rest==1.3.4 10 | openupgradelib==3.6.1 11 | paramiko==3.4.1 12 | parse-accept-language==0.1.2 13 | paypalrestsdk==1.13.3 14 | phonenumbers==8.13.44 15 | pyquerystring==1.1 16 | pyOpenSSL==24.2.1 17 | pyquerystring==1.1 18 | pysimplesoap==1.16.2 19 | requests-mock==1.12.1 20 | slugify==0.0.1 21 | stripe==10.8.0 22 | unidecode==1.3.8 23 | vcrpy==6.0.1 24 | 25 | # Library dependency 26 | asn1crypto==1.5.1 27 | bcrypt==4.2.0 28 | botocore==1.35.6 29 | cffi==1.17.0 30 | dateparser==1.2.0 31 | idna==3.8 32 | jmespath==1.0.1 33 | multidict==6.0.5 34 | pdfminer.six==20240706 35 | pyasn1==0.6.0 36 | pycparser==2.22 37 | pycryptodome==3.20.0 38 | PyNaCl==1.5.0 39 | pytesseract==0.3.13 40 | regex==2024.7.24 41 | s3transfer==0.10.2 42 | tzlocal==5.2 43 | Unidecode==1.3.8 44 | yarl==1.9.4 45 | 46 | -------------------------------------------------------------------------------- /14.0/src_requirements.txt: -------------------------------------------------------------------------------- 1 | # Requirements for the project itself and for Odoo. 2 | # When we install Odoo with -e, odoo.py is available in the PATH and 3 | # 'openerp' in the PYTHONPATH 4 | # 5 | # They are installed only after all the project's files have been copied 6 | # into the image (with ONBUILD) 7 | -e . 8 | -e src 9 | -------------------------------------------------------------------------------- /14.0/templates/odoo.cfg.tmpl: -------------------------------------------------------------------------------- 1 | [options] 2 | addons_path = {{ .Env.ADDONS_PATH }} 3 | data_dir = /odoo/data/odoo 4 | auto_reload = False 5 | db_host = {{ .Env.DB_HOST }} 6 | db_name = {{ .Env.DB_NAME }} 7 | db_user = {{ .Env.DB_USER }} 8 | db_password = {{ .Env.DB_PASSWORD }} 9 | db_sslmode = {{ default .Env.DB_SSLMODE "prefer" }} 10 | dbfilter = ^{{ default .Env.DB_FILTER .Env.DB_NAME }}$ 11 | list_db = {{ default .Env.LIST_DB "False" }} 12 | admin_passwd = {{ default .Env.ADMIN_PASSWD "" }} 13 | db_maxconn = {{ default .Env.DB_MAXCONN "64" }} 14 | limit_memory_soft = {{ default .Env.LIMIT_MEMORY_SOFT "2147483648" }} 15 | limit_memory_hard = {{ default .Env.LIMIT_MEMORY_HARD "2684354560" }} 16 | limit_request = {{ default .Env.LIMIT_REQUEST "8192" }} 17 | limit_time_cpu = {{ default .Env.LIMIT_TIME_CPU "60" }} 18 | limit_time_real = {{ default .Env.LIMIT_TIME_REAL "120" }} 19 | limit_time_real_cron = {{ default .Env.LIMIT_TIME_REAL_CRON "120" }} 20 | log_handler = {{ default .Env.LOG_HANDLER "':INFO'" }} 21 | log_level = {{ default .Env.LOG_LEVEL "info" }} 22 | max_cron_threads = {{ default .Env.MAX_CRON_THREADS "2" }} 23 | workers = {{ default .Env.WORKERS "4" }} 24 | logfile = {{ default .Env.LOGFILE "None" }} 25 | log_db = {{ default .Env.LOG_DB "False" }} 26 | logrotate = True 27 | syslog = {{ default .Env.SYSLOG "False" }} 28 | running_env = {{ default .Env.RUNNING_ENV "dev" }} 29 | without_demo = {{ default .Env.WITHOUT_DEMO "True" }} 30 | server_wide_modules = {{ default .Env.SERVER_WIDE_MODULES "" }} 31 | ; db_sslmode = 32 | ; We can activate proxy_mode even if we are not behind a proxy, because 33 | ; it is used only if HTTP_X_FORWARDED_HOST is set in environ 34 | proxy_mode = True 35 | ; csv_internal_sep = , 36 | ; db_template = template1 37 | ; debug_mode = False 38 | ; email_from = False 39 | ; http_port = 8069 40 | ; http_enable = True 41 | ; http_interface = 42 | ; longpolling_port = 8072 43 | ; osv_memory_age_limit = 1.0 44 | ; osv_memory_count_limit = False 45 | ; smtp_password = False 46 | ; smtp_port = 25 47 | ; smtp_server = localhost 48 | ; smtp_ssl = False 49 | ; smtp_user = False 50 | unaccent = {{ default .Env.UNACCENT "False" }} 51 | {{ default .Env.ADDITIONAL_ODOO_RC "" }} 52 | -------------------------------------------------------------------------------- /14.0/test_requirements.txt: -------------------------------------------------------------------------------- 1 | # test / lint 2 | # those libs and their dependencies are unpinned 3 | # to always test with the last version of it 4 | 5 | flake8 6 | pytest==8.3.2 7 | pluggy 8 | coverage 9 | pytest-odoo>=0.4.7 10 | pytest-cov>=2.10.0 11 | watchdog 12 | 13 | -------------------------------------------------------------------------------- /15.0/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM python:3.12-slim-bookworm 2 | ARG UID=999 3 | ARG GID=999 4 | # create the working directory and a place to set the logs (if wanted) 5 | RUN mkdir -p /odoo /var/log/odoo 6 | 7 | COPY ./install /install 8 | COPY ./base_requirements.txt /odoo 9 | COPY ./extra_requirements.txt /odoo 10 | COPY ./test_requirements.txt /odoo 11 | 12 | # Moved because there was a bug while installing `odoo-autodiscover`. There is 13 | # an accent in the contributor name 14 | ENV LANG=C.UTF-8 \ 15 | LC_ALL=C.UTF-8 16 | 17 | # build and dev packages 18 | ENV BUILD_PACKAGE \ 19 | build-essential \ 20 | gcc \ 21 | libevent-dev \ 22 | libfreetype6-dev \ 23 | libxml2-dev \ 24 | libxslt1-dev \ 25 | libsasl2-dev \ 26 | libldap2-dev \ 27 | libssl-dev \ 28 | libjpeg-dev \ 29 | libpng-dev \ 30 | zlib1g-dev \ 31 | libcairo2-dev 32 | 33 | 34 | 35 | # Install some deps, lessc and less-plugin-clean-css, and wkhtmltopdf 36 | # wkhtml-buster is kept as in official image, no deb available for bullseye 37 | RUN set -x; \ 38 | sh -c /install/package_odoo.sh \ 39 | && /install/setup-pip.sh \ 40 | && /install/postgres.sh \ 41 | && /install/kwkhtml_client.sh \ 42 | && /install/kwkhtml_client_force_python3.sh \ 43 | && /install/dev_package.sh 44 | 45 | # grab dockerize to generate template and 46 | # wait on postgres 47 | RUN /install/dockerize.sh 48 | 49 | COPY ./src_requirements.txt /odoo 50 | COPY ./bin /odoo/odoo-bin 51 | COPY ./templates /templates 52 | COPY ./before-migrate-entrypoint.d /odoo/before-migrate-entrypoint.d 53 | COPY ./start-entrypoint.d /odoo/start-entrypoint.d 54 | COPY ./MANIFEST.in /odoo 55 | 56 | RUN groupadd -g $GID odoo \ 57 | && adduser --disabled-password -u $UID --gid $GID --gecos '' odoo \ 58 | && touch /odoo/odoo.cfg \ 59 | && touch /odoo/.bashrc \ 60 | && mkdir -p /odoo/data/odoo/{addons,filestore,sessions} \ 61 | && chown -R odoo:root /odoo && usermod odoo --home /odoo \ 62 | && chown -R odoo:root /var/log/odoo 63 | 64 | VOLUME ["/data/odoo", "/var/log/odoo"] 65 | USER odoo 66 | RUN python3 -m venv /odoo/.venv --system-site-packages 67 | ENV PATH=/odoo/.venv/bin:$PATH 68 | ENV PYTHONPATH=$PYTHONPATH:/odoo/ 69 | RUN echo "export PATH=$PATH" >> ~/.bashrc 70 | 71 | RUN /odoo/.venv/bin/pip install -r /odoo/base_requirements.txt 72 | RUN /odoo/.venv/bin/pip install -r /odoo/extra_requirements.txt 73 | RUN /odoo/.venv/bin/pip install -r /odoo/test_requirements.txt 74 | USER root 75 | RUN set -x; \ 76 | sh -c /install/purge_dev_package_and_cache.sh 77 | RUN chgrp -R 0 /odoo && \ 78 | chmod -R g=u /odoo 79 | USER odoo 80 | EXPOSE 8069 8072 81 | 82 | ENV ODOO_VERSION=15.0 \ 83 | PATH=/odoo/odoo-bin:/odoo/.local/bin:$PATH \ 84 | LANG=C.UTF-8 \ 85 | LC_ALL=C.UTF-8 \ 86 | DB_HOST=db \ 87 | DB_PORT=5432 \ 88 | DB_NAME=odoodb \ 89 | DB_USER=odoo \ 90 | DB_PASSWORD=odoo \ 91 | ODOO_BASE_URL=http://localhost:8069 \ 92 | ODOO_REPORT_URL=http://localhost:8069 \ 93 | # the place where you put the data of your project (csv, ...) 94 | ODOO_DATA_PATH=/odoo/data \ 95 | DEMO=False \ 96 | ADDONS_PATH=/odoo/odoo/addons,/odoo/odoo/src/odoo/addons \ 97 | ODOO_RC=/odoo/odoo.cfg 98 | 99 | ENTRYPOINT ["docker-entrypoint.sh"] 100 | CMD ["odoo"] 101 | -------------------------------------------------------------------------------- /15.0/MANIFEST.in: -------------------------------------------------------------------------------- 1 | recursive-include odoo/data * 2 | -------------------------------------------------------------------------------- /15.0/base_requirements.txt: -------------------------------------------------------------------------------- 1 | Babel==2.9.1 # min version = 2.6.0 (Focal with security backports) 2 | chardet==3.0.4 3 | cryptography==42.0.8 ; python_version >= '3.12' # (Noble) min 41.0.7, pinning 42.0.8 for security fixes 4 | decorator==4.4.2 5 | docutils==0.16 6 | ebaysdk==2.1.5 7 | freezegun==0.3.15; python_version >= '3.8' 8 | gevent==24.2.1 ; sys_platform != 'win32' and python_version >= '3.12' # (Noble) 9 | greenlet==3.0.3 ; sys_platform != 'win32' and python_version >= '3.12' # (Noble) 10 | idna==3.7.0 11 | Jinja2==3.1.6 ; python_version >= '3.12' # (Noble) compatibility with markupsafe 12 | libsass==0.22.0 ; python_version >= '3.12' # (Noble) Mostly to have a wheel package 13 | lxml==5.2.1; python_version >= '3.12' # (Noble - removed html clean) 14 | lxml-html-clean; python_version >= '3.12' # (Noble - removed from lxml, unpinned for futur security patches) 15 | MarkupSafe==2.1.5 ; python_version >= '3.12' # (Noble) Mostly to have a wheel package 16 | num2words==0.5.6 17 | ofxparse==0.21; python_version > '3.9' # (Jammy) 18 | Pillow==10.3.0 ; python_version >= '3.12' # (Noble) Mostly to have a wheel package 19 | polib==1.1.0 20 | psutil==5.9.8 ; python_version >= '3.12' # (Noble) Mostly to have a wheel package 21 | psycopg2==2.9.9 ; python_version >= '3.12' # (Noble) Mostly to have a wheel package 22 | pydot==1.4.1 23 | pyopenssl==24.1.0 ; python_version >= '3.12' # (Noble) min 23.2.0, pinned for compatibility with cryptography==42.0.8 and security patches 24 | PyPDF2==2.12.1 ; python_version >= '3.12' # (Noble) Compatibility with cryptography 25 | pyserial==3.4 26 | python-dateutil==2.7.3 27 | python-ldap==3.4.4 ; sys_platform != 'win32' and python_version >= '3.12' # (Noble) Mostly to have a wheel package 28 | python-stdnum==1.13 29 | pytz # no version pinning to avoid OS perturbations 30 | pyusb==1.2.1 ; python_version >= '3.12' # (Noble) Mostly to have a wheel package 31 | qrcode==6.1 32 | reportlab==4.1.0 ; python_version >= '3.12' # (Noble) Mostly to have a wheel package 33 | pycairo==1.27.0 ; python_version >= '3.12' # Needed only for reportlab 4.0+ https://docs.reportlab.com/install/ReportLab_Plus_version_installation/ 34 | rlPyCairo==0.3.0 35 | requests==2.32.0 ; python_version >= '3.12' # (Noble) Compatibility with i 36 | rl-renderPM==4.0.3 ; sys_platform == 'win32' and python_version >= '3.12' # Needed by reportlab 4.1.0 but included in deb package 37 | urllib3==2.2.2 ; python_version >= '3.12' # (Noble) Compatibility with cryptography 38 | vobject==0.9.6.1 39 | Werkzeug==2.1.1 ; python_version > '3.9' # (Jammy) 40 | xlrd==1.2.0; python_version >= '3.8' 41 | XlsxWriter==1.1.2 42 | xlwt==1.3.0 43 | zeep==3.4.0 44 | 45 | setuptools==78.1.1 46 | 47 | 48 | whool==1.2.0 49 | # Not part of official requirements, but used by some addons 50 | # colorama==0.3.9 51 | gdata==2.0.18 52 | html5lib==1.1 53 | odfpy==1.4.1 54 | pyinotify==0.9.6 55 | simplejson==3.19.3 56 | 57 | # Migration tools 58 | marabunta==0.12.0 59 | -e git+https://github.com/camptocamp/anthem@master#egg=anthem 60 | 61 | 62 | # Library dependency 63 | argh==0.31.3 64 | atomicwrites==1.4.1 65 | attrs==24.2.0 66 | beautifulsoup4==4.12.3 67 | future==1.0.0 68 | mccabe==0.7.0 69 | more-itertools==10.5.0 70 | pbr==6.1.0 71 | pexpect==4.9.0 72 | ptyprocess==0.7.0 73 | 74 | pycodestyle==2.12.1 75 | pyflakes==3.2.0 76 | unicodecsv==0.14.1 77 | wrapt==1.16.0 78 | -------------------------------------------------------------------------------- /15.0/extra_requirements.txt: -------------------------------------------------------------------------------- 1 | # Extra python dependencies 2 | algoliasearch==4.1.1 3 | Adyen==12.3.0 4 | cachetools==5.5.0 5 | cerberus==1.3.5 6 | boto3==1.35.6 7 | factur-x==3.1 8 | invoice2data==0.4.5 9 | mailjet-rest==1.3.4 10 | openupgradelib==3.6.1 11 | paramiko==3.4.1 12 | parse-accept-language==0.1.2 13 | paypalrestsdk==1.13.3 14 | phonenumbers==8.13.44 15 | pyquerystring==1.1 16 | pyOpenSSL==24.2.1 17 | pyquerystring==1.1 18 | pysimplesoap==1.16.2 19 | requests-mock==1.12.1 20 | slugify==0.0.1 21 | stripe==10.8.0 22 | unidecode==1.3.8 23 | vcrpy==6.0.1 24 | 25 | # Library dependency 26 | asn1crypto==1.5.1 27 | bcrypt==4.2.0 28 | botocore==1.35.6 29 | cffi==1.17.0 30 | dateparser==1.2.0 31 | idna==3.8 32 | jmespath==1.0.1 33 | multidict==6.0.5 34 | pdfminer.six==20240706 35 | pyasn1==0.6.0 36 | pycparser==2.22 37 | pycryptodome==3.20.0 38 | PyNaCl==1.5.0 39 | pytesseract==0.3.13 40 | regex==2024.7.24 41 | s3transfer==0.10.2 42 | tzlocal==5.2 43 | Unidecode==1.3.8 44 | yarl==1.9.4 45 | 46 | -------------------------------------------------------------------------------- /15.0/src_requirements.txt: -------------------------------------------------------------------------------- 1 | # Requirements for the project itself and for Odoo. 2 | # When we install Odoo with -e, odoo.py is available in the PATH and 3 | # 'openerp' in the PYTHONPATH 4 | # 5 | # They are installed only after all the project's files have been copied 6 | # into the image (with ONBUILD) 7 | -e . 8 | -e src 9 | -------------------------------------------------------------------------------- /15.0/templates/odoo.cfg.tmpl: -------------------------------------------------------------------------------- 1 | [options] 2 | addons_path = {{ .Env.ADDONS_PATH }} 3 | data_dir = /odoo/data/odoo 4 | auto_reload = False 5 | db_host = {{ .Env.DB_HOST }} 6 | db_name = {{ .Env.DB_NAME }} 7 | db_user = {{ .Env.DB_USER }} 8 | db_password = {{ .Env.DB_PASSWORD }} 9 | db_sslmode = {{ default .Env.DB_SSLMODE "prefer" }} 10 | dbfilter = ^{{ default .Env.DB_FILTER .Env.DB_NAME }}$ 11 | list_db = {{ default .Env.LIST_DB "False" }} 12 | admin_passwd = {{ default .Env.ADMIN_PASSWD "" }} 13 | db_maxconn = {{ default .Env.DB_MAXCONN "64" }} 14 | limit_memory_soft = {{ default .Env.LIMIT_MEMORY_SOFT "2147483648" }} 15 | limit_memory_hard = {{ default .Env.LIMIT_MEMORY_HARD "2684354560" }} 16 | limit_request = {{ default .Env.LIMIT_REQUEST "8192" }} 17 | limit_time_cpu = {{ default .Env.LIMIT_TIME_CPU "60" }} 18 | limit_time_real = {{ default .Env.LIMIT_TIME_REAL "120" }} 19 | limit_time_real_cron = {{ default .Env.LIMIT_TIME_REAL_CRON "120" }} 20 | log_handler = {{ default .Env.LOG_HANDLER "':INFO'" }} 21 | log_level = {{ default .Env.LOG_LEVEL "info" }} 22 | max_cron_threads = {{ default .Env.MAX_CRON_THREADS "2" }} 23 | workers = {{ default .Env.WORKERS "4" }} 24 | logfile = {{ default .Env.LOGFILE "None" }} 25 | log_db = {{ default .Env.LOG_DB "False" }} 26 | logrotate = True 27 | syslog = {{ default .Env.SYSLOG "False" }} 28 | running_env = {{ default .Env.RUNNING_ENV "dev" }} 29 | without_demo = {{ default .Env.WITHOUT_DEMO "True" }} 30 | server_wide_modules = {{ default .Env.SERVER_WIDE_MODULES "" }} 31 | ; db_sslmode = 32 | ; We can activate proxy_mode even if we are not behind a proxy, because 33 | ; it is used only if HTTP_X_FORWARDED_HOST is set in environ 34 | proxy_mode = True 35 | ; csv_internal_sep = , 36 | ; db_template = template1 37 | ; debug_mode = False 38 | ; email_from = False 39 | ; http_port = 8069 40 | ; http_enable = True 41 | ; http_interface = 42 | ; longpolling_port = 8072 43 | ; osv_memory_age_limit = 1.0 44 | ; osv_memory_count_limit = False 45 | ; smtp_password = False 46 | ; smtp_port = 25 47 | ; smtp_server = localhost 48 | ; smtp_ssl = False 49 | ; smtp_user = False 50 | unaccent = {{ default .Env.UNACCENT "False" }} 51 | {{ default .Env.ADDITIONAL_ODOO_RC "" }} 52 | -------------------------------------------------------------------------------- /15.0/test_requirements.txt: -------------------------------------------------------------------------------- 1 | # test / lint 2 | # those libs and their dependencies are unpinned 3 | # to always test with the last version of it 4 | 5 | flake8 6 | pytest==8.3.2 7 | pluggy 8 | coverage 9 | pytest-odoo>=0.4.7 10 | pytest-cov>=2.10.0 11 | watchdog 12 | 13 | -------------------------------------------------------------------------------- /16.0/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM python:3.12-slim-bookworm 2 | ARG UID=999 3 | ARG GID=999 4 | # create the working directory and a place to set the logs (if wanted) 5 | RUN mkdir -p /odoo /var/log/odoo 6 | 7 | COPY ./install /install 8 | COPY ./base_requirements.txt /odoo 9 | COPY ./extra_requirements.txt /odoo 10 | 11 | # Moved because there was a bug while installing `odoo-autodiscover`. There is 12 | # an accent in the contributor name 13 | ENV LANG=C.UTF-8 \ 14 | LC_ALL=C.UTF-8 15 | 16 | # build and dev packages 17 | ENV BUILD_PACKAGE \ 18 | build-essential \ 19 | gcc \ 20 | libevent-dev \ 21 | libfreetype6-dev \ 22 | libxml2-dev \ 23 | libxslt1-dev \ 24 | libsasl2-dev \ 25 | libldap2-dev \ 26 | libssl-dev \ 27 | libjpeg-dev \ 28 | libpng-dev \ 29 | zlib1g-dev \ 30 | libcairo2-dev 31 | 32 | # Install some deps, lessc and less-plugin-clean-css, and wkhtmltopdf 33 | # wkhtml-buster is kept as in official image, no deb available for bullseye 34 | RUN set -x; \ 35 | sh -c /install/package_odoo.sh \ 36 | && /install/setup-pip.sh \ 37 | && /install/postgres.sh \ 38 | && /install/kwkhtml_client.sh \ 39 | && /install/kwkhtml_client_force_python3.sh \ 40 | && /install/dev_package.sh 41 | 42 | # grab dockerize to generate template and 43 | # wait on postgres 44 | RUN /install/dockerize.sh 45 | 46 | COPY ./src_requirements.txt /odoo 47 | COPY ./bin /odoo/odoo-bin 48 | COPY ./templates /templates 49 | COPY ./before-migrate-entrypoint.d /odoo/before-migrate-entrypoint.d 50 | COPY ./start-entrypoint.d /odoo/start-entrypoint.d 51 | COPY ./MANIFEST.in /odoo 52 | 53 | RUN groupadd -g $GID odoo \ 54 | && adduser --disabled-password -u $UID --gid $GID --gecos '' odoo \ 55 | && touch /odoo/odoo.cfg \ 56 | && touch /odoo/.bashrc \ 57 | && mkdir -p /odoo/data/odoo/{addons,filestore,sessions} \ 58 | && chown -R odoo:root /odoo && usermod odoo --home /odoo \ 59 | && chown -R odoo:root /var/log/odoo 60 | 61 | VOLUME ["/data/odoo", "/var/log/odoo"] 62 | USER odoo 63 | RUN python3 -m venv /odoo/.venv --system-site-packages 64 | ENV PATH=/odoo/.venv/bin:$PATH 65 | ENV PYTHONPATH=$PYTHONPATH:/odoo/ 66 | RUN echo "export PATH=$PATH" >> ~/.bashrc 67 | 68 | RUN /odoo/.venv/bin/pip install -r /odoo/base_requirements.txt 69 | RUN /odoo/.venv/bin/pip install -r /odoo/extra_requirements.txt 70 | USER root 71 | RUN set -x; \ 72 | sh -c /install/purge_dev_package_and_cache.sh 73 | RUN chgrp -R 0 /odoo && \ 74 | chmod -R g=u /odoo 75 | USER odoo 76 | EXPOSE 8069 8072 77 | 78 | ENV ODOO_VERSION=16.0 \ 79 | PATH=/odoo/odoo-bin:/odoo/.local/bin:$PATH \ 80 | LANG=C.UTF-8 \ 81 | LC_ALL=C.UTF-8 \ 82 | DB_HOST=db \ 83 | DB_PORT=5432 \ 84 | DB_NAME=odoodb \ 85 | DB_USER=odoo \ 86 | DB_PASSWORD=odoo \ 87 | ODOO_BASE_URL=http://localhost:8069 \ 88 | ODOO_REPORT_URL=http://localhost:8069 \ 89 | # the place where you put the data of your project (csv, ...) 90 | ODOO_DATA_PATH=/odoo/data \ 91 | DEMO=False \ 92 | ADDONS_PATH=/odoo/odoo/addons,/odoo/odoo/src/odoo/addons \ 93 | ODOO_RC=/odoo/odoo.cfg 94 | 95 | ENTRYPOINT ["docker-entrypoint.sh"] 96 | CMD ["odoo"] 97 | -------------------------------------------------------------------------------- /16.0/MANIFEST.in: -------------------------------------------------------------------------------- 1 | recursive-include odoo/data * 2 | -------------------------------------------------------------------------------- /16.0/base_requirements.txt: -------------------------------------------------------------------------------- 1 | # The officially supported versions of the following packages are their 2 | # python3-* equivalent distributed in Ubuntu 22.04 and Debian 11 3 | Babel==2.9.1 # min version = 2.6.0 (Focal with security backports) 4 | chardet==4.0.0 5 | cryptography==42.0.8 ; python_version >= '3.12' # (Noble) min 41.0.7, pinning 42.0.8 for security fixes 6 | decorator==4.4.2 7 | docutils==0.16 8 | ebaysdk==2.1.5 9 | whool==1.2.0 10 | freezegun==0.3.15; python_version >= '3.8' 11 | gevent==24.2.1 ; sys_platform != 'win32' and python_version >= '3.12' # (Noble) 12 | greenlet==3.0.3 ; sys_platform != 'win32' and python_version >= '3.12' # (Noble) 13 | idna==3.7.0 14 | Jinja2==3.1.6 ; python_version >= '3.12' # (Noble) compatibility with markupsafe 15 | libsass==0.22.0 ; python_version >= '3.12' # (Noble) Mostly to have a wheel package 16 | lxml==5.2.1; python_version >= '3.12' # (Noble - removed html clean) 17 | lxml-html-clean; python_version >= '3.12' # (Noble - removed from lxml, unpinned for futur security patches) 18 | MarkupSafe==2.1.5 ; python_version >= '3.12' # (Noble) Mostly to have a wheel package 19 | num2words==0.5.9 20 | ofxparse==0.21; python_version > '3.9' # (Jammy) 21 | passlib==1.7.4 # min version = 1.7.2 (Focal with security backports) 22 | Pillow==10.3.0 ; python_version >= '3.12' # (Noble) Mostly to have a wheel package 23 | polib==1.1.0 24 | psutil==5.9.8 ; python_version >= '3.12' # (Noble) Mostly to have a wheel package 25 | psycopg2==2.9.9 ; python_version >= '3.12' # (Noble) Mostly to have a wheel package 26 | pydot==1.4.2 27 | pyopenssl==24.1.0 ; python_version >= '3.12' # (Noble) min 23.2.0, pinned for compatibility with cryptography==42.0.8 and security patches 28 | PyPDF2==2.12.1 ; python_version > '3.10' 29 | pyserial==3.5 30 | python-dateutil==2.8.1 31 | python-ldap==3.4.4 ; sys_platform != 'win32' and python_version >= '3.12' # (Noble) Mostly to have a wheel package 32 | python-stdnum==1.16 33 | pytz # no version pinning to avoid OS perturbations 34 | pyusb==1.2.1 ; python_version > '3.10' 35 | qrcode==6.1 36 | reportlab==4.1.0 ; python_version >= '3.12' # (Noble) Mostly to have a wheel package 37 | pycairo==1.27.0 ; python_version >= '3.12' # Needed only for reportlab 4.0+ https://docs.reportlab.com/install/ReportLab_Plus_version_installation/ 38 | rlPyCairo==0.3.0 39 | requests==2.32.0 ; python_version >= '3.12' # (Noble) Compatibility with i 40 | rl-renderPM==4.0.3 ; sys_platform == 'win32' and python_version >= '3.12' # Needed by reportlab 4.1.0 but included in deb package 41 | urllib3==2.2.2 ; python_version >= '3.12' # (Noble) Compatibility with cryptography 42 | vobject==0.9.6.1 43 | Werkzeug==2.1.1 ; python_version > '3.9' # (Jammy) 44 | xlrd==1.2.0; python_version >= '3.8' 45 | XlsxWriter==1.1.2 46 | xlwt==1.3.0 47 | zeep==4.0.0 48 | 49 | setuptools==78.1.1 50 | 51 | # Not part of official requirements, but used by some addons 52 | # colorama==0.3.9 53 | gdata==2.0.18 54 | html5lib==1.1 55 | odfpy==1.4.1 56 | pyinotify==0.9.6 57 | simplejson==3.19.3 58 | 59 | # Migration tools 60 | marabunta==0.12.0 61 | -e git+https://github.com/camptocamp/anthem@master#egg=anthem 62 | 63 | # Library dependency 64 | argh==0.31.3 65 | atomicwrites==1.4.1 66 | attrs==24.2.0 67 | beautifulsoup4==4.12.3 68 | future==1.0.0 69 | mccabe==0.7.0 70 | more-itertools==10.5.0 71 | pbr==6.1.0 72 | pexpect==4.9.0 73 | ptyprocess==0.7.0 74 | pycodestyle==2.12.1 75 | pyflakes==3.2.0 76 | unicodecsv==0.14.1 77 | wrapt==1.16.0 78 | -------------------------------------------------------------------------------- /16.0/extra_requirements.txt: -------------------------------------------------------------------------------- 1 | # Extra python dependencies 2 | algoliasearch==4.1.1 3 | Adyen==12.3.0 4 | cachetools==5.5.0 5 | cerberus==1.3.5 6 | boto3==1.35.6 7 | factur-x==3.1 8 | invoice2data==0.4.5 9 | mailjet-rest==1.3.4 10 | openupgradelib==3.6.1 11 | paramiko==3.4.1 12 | parse-accept-language==0.1.2 13 | paypalrestsdk==1.13.3 14 | phonenumbers==8.13.44 15 | pyquerystring==1.1 16 | pyOpenSSL==24.2.1 17 | pyquerystring==1.1 18 | pysimplesoap==1.16.2 19 | requests-mock==1.12.1 20 | slugify==0.0.1 21 | stripe==10.8.0 22 | unidecode==1.3.8 23 | vcrpy==6.0.1 24 | 25 | # Library dependency 26 | asn1crypto==1.5.1 27 | bcrypt==4.2.0 28 | botocore==1.35.6 29 | cffi==1.17.0 30 | dateparser==1.2.0 31 | idna==3.8 32 | jmespath==1.0.1 33 | multidict==6.0.5 34 | pdfminer.six==20240706 35 | pyasn1==0.6.0 36 | pycparser==2.22 37 | pycryptodome==3.20.0 38 | PyNaCl==1.5.0 39 | pytesseract==0.3.13 40 | regex==2024.7.24 41 | s3transfer==0.10.2 42 | tzlocal==5.2 43 | Unidecode==1.3.8 44 | yarl==1.9.4 45 | -------------------------------------------------------------------------------- /16.0/src_requirements.txt: -------------------------------------------------------------------------------- 1 | # Requirements for the project itself and for Odoo. 2 | # When we install Odoo with -e, odoo.py is available in the PATH and 3 | # 'openerp' in the PYTHONPATH 4 | # 5 | # They are installed only after all the project's files have been copied 6 | # into the image (with ONBUILD) 7 | -e . 8 | -e src 9 | -------------------------------------------------------------------------------- /16.0/templates/odoo.cfg.tmpl: -------------------------------------------------------------------------------- 1 | [options] 2 | addons_path = {{ .Env.ADDONS_PATH }} 3 | data_dir = /odoo/data/odoo 4 | auto_reload = False 5 | db_host = {{ .Env.DB_HOST }} 6 | db_name = {{ .Env.DB_NAME }} 7 | db_user = {{ .Env.DB_USER }} 8 | db_password = {{ .Env.DB_PASSWORD }} 9 | db_sslmode = {{ default .Env.DB_SSLMODE "prefer" }} 10 | dbfilter = ^{{ default .Env.DB_FILTER .Env.DB_NAME }}$ 11 | list_db = {{ default .Env.LIST_DB "False" }} 12 | admin_passwd = {{ default .Env.ADMIN_PASSWD "" }} 13 | db_maxconn = {{ default .Env.DB_MAXCONN "64" }} 14 | limit_memory_soft = {{ default .Env.LIMIT_MEMORY_SOFT "2147483648" }} 15 | limit_memory_hard = {{ default .Env.LIMIT_MEMORY_HARD "2684354560" }} 16 | limit_request = {{ default .Env.LIMIT_REQUEST "8192" }} 17 | limit_time_cpu = {{ default .Env.LIMIT_TIME_CPU "60" }} 18 | limit_time_real = {{ default .Env.LIMIT_TIME_REAL "120" }} 19 | limit_time_real_cron = {{ default .Env.LIMIT_TIME_REAL_CRON "120" }} 20 | log_handler = {{ default .Env.LOG_HANDLER "':INFO'" }} 21 | log_level = {{ default .Env.LOG_LEVEL "info" }} 22 | max_cron_threads = {{ default .Env.MAX_CRON_THREADS "2" }} 23 | workers = {{ default .Env.WORKERS "4" }} 24 | logfile = {{ default .Env.LOGFILE "None" }} 25 | log_db = {{ default .Env.LOG_DB "False" }} 26 | logrotate = True 27 | syslog = {{ default .Env.SYSLOG "False" }} 28 | running_env = {{ default .Env.RUNNING_ENV "dev" }} 29 | without_demo = {{ default .Env.WITHOUT_DEMO "True" }} 30 | server_wide_modules = {{ default .Env.SERVER_WIDE_MODULES "" }} 31 | ; db_sslmode = 32 | ; We can activate proxy_mode even if we are not behind a proxy, because 33 | ; it is used only if HTTP_X_FORWARDED_HOST is set in environ 34 | proxy_mode = True 35 | ; csv_internal_sep = , 36 | ; db_template = template1 37 | ; debug_mode = False 38 | ; email_from = False 39 | ; http_port = 8069 40 | ; http_enable = True 41 | ; http_interface = 42 | ; longpolling_port = 8072 43 | ; osv_memory_age_limit = 1.0 44 | ; osv_memory_count_limit = False 45 | ; smtp_password = False 46 | ; smtp_port = 25 47 | ; smtp_server = localhost 48 | ; smtp_ssl = False 49 | ; smtp_user = False 50 | unaccent = {{ default .Env.UNACCENT "False" }} 51 | {{ default .Env.ADDITIONAL_ODOO_RC "" }} 52 | -------------------------------------------------------------------------------- /16.0/test_requirements.txt: -------------------------------------------------------------------------------- 1 | # test / lint 2 | # those libs and their dependencies are unpinned 3 | # to always test with the last version of it 4 | flake8 5 | pytest==8.3.2 6 | pluggy 7 | coverage 8 | pytest-odoo>=0.4.7 9 | pytest-cov>=2.10.0 10 | watchdog 11 | -------------------------------------------------------------------------------- /17.0/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM python:3.12-slim-bookworm 2 | ARG UID=999 3 | ARG GID=999 4 | # create the working directory and a place to set the logs (if wanted) 5 | RUN mkdir -p /odoo /var/log/odoo 6 | 7 | COPY ./install /install 8 | COPY ./base_requirements.txt /odoo 9 | COPY ./extra_requirements.txt /odoo 10 | COPY ./test_requirements.txt /odoo 11 | 12 | # Moved because there was a bug while installing `odoo-autodiscover`. There is 13 | # an accent in the contributor name 14 | ENV LANG=C.UTF-8 \ 15 | LC_ALL=C.UTF-8 16 | 17 | # build and dev packages 18 | ENV BUILD_PACKAGE \ 19 | build-essential \ 20 | gcc \ 21 | libevent-dev \ 22 | libfreetype6-dev \ 23 | libxml2-dev \ 24 | libxslt1-dev \ 25 | libsasl2-dev \ 26 | libldap2-dev \ 27 | libssl-dev \ 28 | libjpeg-dev \ 29 | libpng-dev \ 30 | zlib1g-dev \ 31 | libcairo2-dev 32 | 33 | # run in a virtualenv 34 | # Install some deps, lessc and less-plugin-clean-css, and wkhtmltopdf 35 | # wkhtml-buster is kept as in official image, no deb available for bullseye 36 | RUN set -x; \ 37 | sh -c /install/package_odoo.sh \ 38 | && /install/setup-pip.sh \ 39 | && /install/postgres.sh \ 40 | && /install/kwkhtml_client.sh \ 41 | && /install/kwkhtml_client_force_python3.sh \ 42 | && /install/dev_package.sh 43 | 44 | # grab dockerize to generate template and 45 | # wait on postgres 46 | RUN /install/dockerize.sh 47 | 48 | COPY ./src_requirements.txt /odoo 49 | COPY ./bin /odoo/odoo-bin 50 | COPY ./templates /templates 51 | COPY ./before-migrate-entrypoint.d /odoo/before-migrate-entrypoint.d 52 | COPY ./start-entrypoint.d /odoo/start-entrypoint.d 53 | COPY ./MANIFEST.in /odoo 54 | 55 | RUN groupadd -g $GID odoo \ 56 | && adduser --disabled-password -u $UID --gid $GID --gecos '' odoo \ 57 | && touch /odoo/odoo.cfg \ 58 | && touch /odoo/.bashrc \ 59 | && mkdir -p /odoo/data/odoo/{addons,filestore,sessions} \ 60 | && chown -R odoo:root /odoo && usermod odoo --home /odoo \ 61 | && chown -R odoo:root /var/log/odoo 62 | 63 | VOLUME ["/data/odoo", "/var/log/odoo"] 64 | USER odoo 65 | RUN python3 -m venv /odoo/.venv --system-site-packages 66 | ENV PATH=/odoo/.venv/bin:$PATH 67 | ENV PYTHONPATH=$PYTHONPATH:/odoo/ 68 | RUN echo "export PATH=$PATH" >> ~/.bashrc 69 | 70 | RUN /odoo/.venv/bin/pip install -r /odoo/base_requirements.txt 71 | RUN /odoo/.venv/bin/pip install -r /odoo/extra_requirements.txt 72 | RUN /odoo/.venv/bin/pip install -r /odoo/test_requirements.txt 73 | USER root 74 | RUN set -x; \ 75 | sh -c /install/purge_dev_package_and_cache.sh 76 | RUN chgrp -R 0 /odoo && \ 77 | chmod -R g=u /odoo 78 | USER odoo 79 | EXPOSE 8069 8072 80 | 81 | ENV ODOO_VERSION=17.0 \ 82 | PATH=/odoo/odoo-bin:/odoo/.local/bin:$PATH \ 83 | LANG=C.UTF-8 \ 84 | LC_ALL=C.UTF-8 \ 85 | DB_HOST=db \ 86 | DB_PORT=5432 \ 87 | DB_NAME=odoodb \ 88 | DB_USER=odoo \ 89 | DB_PASSWORD=odoo \ 90 | ODOO_BASE_URL=http://localhost:8069 \ 91 | ODOO_REPORT_URL=http://localhost:8069 \ 92 | # the place where you put the data of your project (csv, ...) 93 | ODOO_DATA_PATH=/odoo/data \ 94 | DEMO=False \ 95 | ADDONS_PATH=/odoo/odoo/addons,/odoo/odoo/src/odoo/addons \ 96 | ODOO_RC=/odoo/odoo.cfg 97 | 98 | ENTRYPOINT ["docker-entrypoint.sh"] 99 | CMD ["odoo"] 100 | -------------------------------------------------------------------------------- /17.0/MANIFEST.in: -------------------------------------------------------------------------------- 1 | recursive-include odoo/data * 2 | -------------------------------------------------------------------------------- /17.0/base_requirements.txt: -------------------------------------------------------------------------------- 1 | Babel==2.10.3 ; python_version >= '3.11' 2 | chardet==5.2.0 ; python_version >= '3.11' 3 | cryptography==42.0.8 ; python_version >= '3.12' # (Noble) min 41.0.7, pinning 42.0.8 for security fixes 4 | decorator==5.1.1 ; python_version >= '3.11' 5 | docutils==0.20.1 ; python_version >= '3.11' 6 | ebaysdk==2.1.5 7 | freezegun==1.2.1 ; python_version >= '3.11' 8 | whool==1.2.0 9 | geoip2==2.9.0 10 | gevent==24.2.1 ; sys_platform != 'win32' and python_version >= '3.12' # (Noble) 11 | greenlet==3.0.3 ; sys_platform != 'win32' and python_version >= '3.12' # (Noble) 12 | idna==3.7.0 13 | Jinja2==3.1.6 ; python_version >= '3.12' # (Noble) compatibility with markupsafe 14 | libsass==0.22.0 ; python_version >= '3.12' # (Noble) Mostly to have a wheel package 15 | lxml==5.2.1; python_version >= '3.12' # (Noble - removed html clean) 16 | lxml-html-clean; python_version >= '3.12' # (Noble - removed from lxml, unpinned for futur security patches) 17 | MarkupSafe==2.1.5 ; python_version >= '3.12' # (Noble) Mostly to have a wheel package 18 | num2words==0.5.13 ; python_version >= '3.12' 19 | ofxparse==0.21 20 | passlib==1.7.4 # min version = 1.7.2 (Focal with security backports) 21 | Pillow==10.3.0 ; python_version >= '3.12' # (Noble) Mostly to have a wheel package 22 | polib==1.1.0 23 | psutil==5.9.8 ; python_version >= '3.12' # (Noble) Mostly to have a wheel package 24 | psycopg2==2.9.9 ; python_version >= '3.12' # (Noble) Mostly to have a wheel package 25 | pydot==1.4.2 26 | pyopenssl==24.1.0 ; python_version >= '3.12' # (Noble) min 23.2.0, pinned for compatibility with cryptography==42.0.8 and security patches 27 | PyPDF2==2.12.1 ; python_version > '3.10' 28 | pyserial==3.5 29 | python-dateutil==2.8.2 ; python_version >= '3.11' 30 | python-ldap==3.4.4 ; sys_platform != 'win32' and python_version >= '3.12' # (Noble) Mostly to have a wheel package 31 | python-stdnum==1.19 ; python_version >= '3.11' 32 | pytz # no version pinning to avoid OS perturbations 33 | pyusb==1.2.1 34 | qrcode==7.4.2 ; python_version >= '3.11' 35 | reportlab==4.1.0 ; python_version >= '3.12' # (Noble) Mostly to have a wheel package 36 | pycairo==1.27.0 ; python_version >= '3.12' # Needed only for reportlab 4.0+ https://docs.reportlab.com/install/ReportLab_Plus_version_installation/ 37 | rlPyCairo==0.3.0 38 | requests==2.32.0 ; python_version >= '3.11' # (Noble) 39 | rjsmin==1.2.0 ; python_version >= '3.11' 40 | rl-renderPM==4.0.3 ; sys_platform == 'win32' and python_version >= '3.12' # Needed by reportlab 4.1.0 but included in deb package 41 | urllib3==2.2.2 ; python_version >= '3.12' # (Noble) Compatibility with cryptography 42 | vobject==0.9.6.1 43 | Werkzeug==3.0.6 ; python_version >= '3.12' # (Noble) Avoid deprecation warnings 44 | xlrd==2.0.1 ; python_version >= '3.12' 45 | XlsxWriter==3.1.9 ; python_version >= '3.12' 46 | xlwt==1.3.0 47 | zeep==4.2.1 ; python_version >= '3.11' 48 | setuptools==78.1.1 49 | 50 | # Not part of official requirements, but used by some addons 51 | # colorama==0.3.9 52 | gdata==2.0.18 53 | html5lib==1.1 54 | odfpy==1.4.1 55 | pyinotify==0.9.6 56 | simplejson==3.19.3 57 | 58 | 59 | # Migration tools 60 | marabunta==0.12.0 61 | -e git+https://github.com/camptocamp/anthem@master#egg=anthem 62 | 63 | # Library dependency 64 | argh==0.31.3 65 | atomicwrites==1.4.1 66 | attrs==24.2.0 67 | beautifulsoup4==4.12.3 68 | future==1.0.0 69 | mccabe==0.7.0 70 | more-itertools==10.4.0 71 | pbr==6.0.0 72 | pexpect==4.9.0 73 | ptyprocess==0.7.0 74 | pycodestyle==2.12.1 75 | pyflakes==3.2.0 76 | unicodecsv==0.14.1 77 | wrapt==1.16.0 78 | -------------------------------------------------------------------------------- /17.0/extra_requirements.txt: -------------------------------------------------------------------------------- 1 | # Extra python dependencies 2 | algoliasearch==4.1.1 3 | Adyen==12.3.0 4 | cachetools==5.5.0 5 | cerberus==1.3.5 6 | boto3==1.35.6 7 | factur-x==3.1 8 | invoice2data==0.4.5 9 | mailjet-rest==1.3.4 10 | openupgradelib==3.6.1 11 | paramiko==3.4.1 12 | parse-accept-language==0.1.2 13 | paypalrestsdk==1.13.3 14 | phonenumbers==8.13.44 15 | pyquerystring==1.1 16 | pyOpenSSL==24.2.1 17 | pyquerystring==1.1 18 | pysimplesoap==1.16.2 19 | requests-mock==1.12.1 20 | slugify==0.0.1 21 | stripe==10.8.0 22 | unidecode==1.3.8 23 | vcrpy==6.0.1 24 | 25 | # Library dependency 26 | asn1crypto==1.5.1 27 | bcrypt==4.2.0 28 | botocore==1.35.6 29 | cffi==1.17.0 30 | cryptography==43.0.0 31 | dateparser==1.2.0 32 | idna==3.8 33 | jmespath==1.0.1 34 | multidict==6.0.5 35 | pdfminer.six==20240706 36 | pyasn1==0.6.0 37 | pycparser==2.22 38 | pycryptodome==3.20.0 39 | PyNaCl==1.5.0 40 | pytesseract==0.3.13 41 | regex==2024.7.24 42 | s3transfer==0.10.2 43 | tzlocal==5.2 44 | Unidecode==1.3.8 45 | yarl==1.9.4 46 | -------------------------------------------------------------------------------- /17.0/src_requirements.txt: -------------------------------------------------------------------------------- 1 | # Requirements for the project itself and for Odoo. 2 | # When we install Odoo with -e, odoo.py is available in the PATH and 3 | # 'openerp' in the PYTHONPATH 4 | # 5 | # They are installed only after all the project's files have been copied 6 | # into the image (with ONBUILD) 7 | -e . 8 | -e src 9 | -------------------------------------------------------------------------------- /17.0/templates/odoo.cfg.tmpl: -------------------------------------------------------------------------------- 1 | [options] 2 | addons_path = {{ .Env.ADDONS_PATH }} 3 | data_dir = /odoo/data/odoo 4 | auto_reload = False 5 | db_host = {{ .Env.DB_HOST }} 6 | db_name = {{ .Env.DB_NAME }} 7 | db_user = {{ .Env.DB_USER }} 8 | db_password = {{ .Env.DB_PASSWORD }} 9 | db_sslmode = {{ default .Env.DB_SSLMODE "prefer" }} 10 | dbfilter = ^{{ default .Env.DB_FILTER .Env.DB_NAME }}$ 11 | list_db = {{ default .Env.LIST_DB "False" }} 12 | admin_passwd = {{ default .Env.ADMIN_PASSWD "" }} 13 | db_maxconn = {{ default .Env.DB_MAXCONN "64" }} 14 | limit_memory_soft = {{ default .Env.LIMIT_MEMORY_SOFT "2147483648" }} 15 | limit_memory_hard = {{ default .Env.LIMIT_MEMORY_HARD "2684354560" }} 16 | limit_request = {{ default .Env.LIMIT_REQUEST "8192" }} 17 | limit_time_cpu = {{ default .Env.LIMIT_TIME_CPU "60" }} 18 | limit_time_real = {{ default .Env.LIMIT_TIME_REAL "120" }} 19 | limit_time_real_cron = {{ default .Env.LIMIT_TIME_REAL_CRON "120" }} 20 | log_handler = {{ default .Env.LOG_HANDLER "':INFO'" }} 21 | log_level = {{ default .Env.LOG_LEVEL "info" }} 22 | max_cron_threads = {{ default .Env.MAX_CRON_THREADS "2" }} 23 | workers = {{ default .Env.WORKERS "4" }} 24 | logfile = {{ default .Env.LOGFILE "None" }} 25 | log_db = {{ default .Env.LOG_DB "False" }} 26 | logrotate = True 27 | syslog = {{ default .Env.SYSLOG "False" }} 28 | running_env = {{ default .Env.RUNNING_ENV "dev" }} 29 | without_demo = {{ default .Env.WITHOUT_DEMO "True" }} 30 | server_wide_modules = {{ default .Env.SERVER_WIDE_MODULES "" }} 31 | ; db_sslmode = 32 | ; We can activate proxy_mode even if we are not behind a proxy, because 33 | ; it is used only if HTTP_X_FORWARDED_HOST is set in environ 34 | proxy_mode = True 35 | ; csv_internal_sep = , 36 | ; db_template = template1 37 | ; debug_mode = False 38 | ; email_from = False 39 | ; http_port = 8069 40 | ; http_enable = True 41 | ; http_interface = 42 | ; longpolling_port = 8072 43 | ; osv_memory_age_limit = 1.0 44 | ; osv_memory_count_limit = False 45 | ; smtp_password = False 46 | ; smtp_port = 25 47 | ; smtp_server = localhost 48 | ; smtp_ssl = False 49 | ; smtp_user = False 50 | unaccent = {{ default .Env.UNACCENT "False" }} 51 | {{ default .Env.ADDITIONAL_ODOO_RC "" }} 52 | -------------------------------------------------------------------------------- /17.0/test_requirements.txt: -------------------------------------------------------------------------------- 1 | # test / lint 2 | # those libs and their dependencies are unpinned 3 | # to always test with the last version of it 4 | flake8 5 | pytest==8.3.2 6 | pluggy 7 | coverage 8 | pytest-odoo>=0.4.7 9 | pytest-cov>=2.10.0 10 | watchdog 11 | -------------------------------------------------------------------------------- /18.0/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM python:3.12-slim-bookworm 2 | ARG UID=999 3 | ARG GID=999 4 | # create the working directory and a place to set the logs (if wanted) 5 | RUN mkdir -p /odoo /var/log/odoo 6 | 7 | COPY ./install /install 8 | COPY ./base_requirements.txt /odoo 9 | COPY ./extra_requirements.txt /odoo 10 | 11 | # Moved because there was a bug while installing `odoo-autodiscover`. There is 12 | # an accent in the contributor name 13 | ENV LANG=C.UTF-8 \ 14 | LC_ALL=C.UTF-8 15 | 16 | # build and dev packages 17 | ENV BUILD_PACKAGE \ 18 | build-essential \ 19 | gcc \ 20 | libevent-dev \ 21 | libfreetype6-dev \ 22 | libxml2-dev \ 23 | libxslt1-dev \ 24 | libsasl2-dev \ 25 | libldap2-dev \ 26 | libssl-dev \ 27 | libjpeg-dev \ 28 | libpng-dev \ 29 | zlib1g-dev \ 30 | libcairo2-dev 31 | 32 | 33 | # Install some deps, lessc and less-plugin-clean-css, and wkhtmltopdf 34 | # wkhtml-buster is kept as in official image, no deb available for bullseye 35 | RUN set -x; \ 36 | sh -c /install/package_odoo.sh \ 37 | && /install/setup-pip.sh \ 38 | && /install/postgres.sh \ 39 | && /install/kwkhtml_client.sh \ 40 | && /install/kwkhtml_client_force_python3.sh \ 41 | && /install/dev_package.sh 42 | 43 | # grab dockerize to generate template and 44 | # wait on postgres 45 | RUN /install/dockerize.sh 46 | COPY ./src_requirements.txt /odoo 47 | COPY ./bin /odoo/odoo-bin 48 | COPY ./templates /templates 49 | COPY ./before-migrate-entrypoint.d /odoo/before-migrate-entrypoint.d 50 | COPY ./start-entrypoint.d /odoo/start-entrypoint.d 51 | COPY ./MANIFEST.in /odoo 52 | 53 | RUN groupadd -g $GID odoo \ 54 | && adduser --disabled-password -u $UID --gid $GID --gecos '' odoo \ 55 | && touch /odoo/odoo.cfg \ 56 | && touch /odoo/.bashrc \ 57 | && mkdir -p /odoo/data/odoo/{addons,filestore,sessions} \ 58 | && chown -R odoo:root /odoo && usermod odoo --home /odoo \ 59 | && chown -R odoo:root /var/log/odoo 60 | 61 | VOLUME ["/data/odoo", "/var/log/odoo"] 62 | USER odoo 63 | RUN python3 -m venv /odoo/.venv --system-site-packages 64 | ENV PATH=/odoo/.venv/bin:$PATH 65 | ENV PYTHONPATH=$PYTHONPATH:/odoo/ 66 | RUN echo "export PATH=$PATH" >> ~/.bashrc 67 | 68 | RUN /odoo/.venv/bin/pip install -r /odoo/base_requirements.txt 69 | RUN /odoo/.venv/bin/pip install -r /odoo/extra_requirements.txt 70 | USER root 71 | RUN set -x; \ 72 | sh -c /install/purge_dev_package_and_cache.sh 73 | RUN chgrp -R 0 /odoo && \ 74 | chmod -R g=u /odoo 75 | USER odoo 76 | EXPOSE 8069 8072 77 | 78 | ENV ODOO_VERSION=18.0 \ 79 | PATH=/odoo/odoo-bin:/odoo/.local/bin:$PATH \ 80 | LANG=C.UTF-8 \ 81 | LC_ALL=C.UTF-8 \ 82 | DB_HOST=db \ 83 | DB_PORT=5432 \ 84 | DB_NAME=odoodb \ 85 | DB_USER=odoo \ 86 | DB_PASSWORD=odoo \ 87 | ODOO_BASE_URL=http://localhost:8069 \ 88 | ODOO_REPORT_URL=http://localhost:8069 \ 89 | # the place where you put the data of your project (csv, ...) 90 | ODOO_DATA_PATH=/odoo/data \ 91 | DEMO=False \ 92 | ADDONS_PATH=/odoo/odoo/addons,/odoo/odoo/src/odoo/addons \ 93 | ODOO_RC=/odoo/odoo.cfg 94 | 95 | ENTRYPOINT ["docker-entrypoint.sh"] 96 | CMD ["odoo"] 97 | -------------------------------------------------------------------------------- /18.0/MANIFEST.in: -------------------------------------------------------------------------------- 1 | recursive-include odoo/data * 2 | -------------------------------------------------------------------------------- /18.0/base_requirements.txt: -------------------------------------------------------------------------------- 1 | # The officially supported versions of the following packages are their 2 | # python3-* equivalent distributed in Ubuntu 24.04 and Debian 12 3 | asn1crypto==1.5.1 ; python_version >= '3.11' 4 | Babel==2.10.3 ; python_version >= '3.11' 5 | cbor2==5.6.2 ; python_version >= '3.12' 6 | chardet==5.2.0 ; python_version >= '3.11' 7 | cryptography==42.0.8 ; python_version >= '3.12' # (Noble) min 41.0.7, pinning 42.0.8 for security fixes 8 | decorator==5.1.1 ; python_version >= '3.11' 9 | docutils==0.20.1 ; python_version >= '3.11' 10 | freezegun==1.2.1 ; python_version >= '3.11' 11 | whool==1.2.0 12 | geoip2==2.9.0 13 | gevent==24.2.1 ; sys_platform != 'win32' and python_version >= '3.12' # (Noble) 14 | greenlet==3.0.3 ; sys_platform != 'win32' and python_version >= '3.12' # (Noble) 15 | idna==3.7 ; python_version >= '3.12' 16 | Jinja2==3.1.6 ; python_version > '3.10' 17 | libsass==0.22.0 ; python_version >= '3.11' # (Noble) Mostly to have a wheel package 18 | lxml==5.2.1; python_version >= '3.12' # (Noble - removed html clean) 19 | lxml-html-clean; python_version >= '3.12' # (Noble - removed from lxml, unpinned for futur security patches) 20 | MarkupSafe==2.1.5 ; python_version >= '3.12' # (Noble) Mostly to have a wheel package 21 | num2words==0.5.13 ; python_version >= '3.12' 22 | ofxparse==0.21 23 | openpyxl==3.1.2 ; python_version >= '3.12' 24 | passlib==1.7.4 # min version = 1.7.2 (Focal with security backports) 25 | Pillow==10.3.0 ; python_version >= '3.12' # (Noble) Mostly to have a wheel package 26 | polib==1.1.1 27 | psutil==5.9.4 ; python_version > '3.10' and python_version < '3.12' 28 | psutil==5.9.8 ; python_version >= '3.12' # (Noble) Mostly to have a wheel package 29 | psycopg2==2.9.9 ; python_version >= '3.12' # (Noble) Mostly to have a wheel package 30 | pyopenssl==24.1.0 ; python_version >= '3.12' # (Noble) min 23.2.0, pinned for compatibility with cryptography==42.0.8 and security patches 31 | PyPDF2==2.12.1 ; python_version > '3.10' 32 | pyserial==3.5 33 | python-dateutil==2.8.2 ; python_version >= '3.11' 34 | python-ldap==3.4.4 ; sys_platform != 'win32' and python_version >= '3.12' # (Noble) Mostly to have a wheel package 35 | python-stdnum==1.19 ; python_version >= '3.11' 36 | pytz # no version pinning to avoid OS perturbations 37 | pyusb==1.2.1 38 | qrcode==7.4.2 ; python_version >= '3.11' 39 | reportlab==4.1.0 ; python_version >= '3.12' # (Noble) Mostly to have a wheel package 40 | pycairo==1.27.0 ; python_version >= '3.12' # Needed only for reportlab 4.0+ https://docs.reportlab.com/install/ReportLab_Plus_version_installation/ 41 | rlPyCairo==0.3.0 42 | requests==2.32.0 ; python_version >= '3.11' # (Noble) 43 | rjsmin==1.2.0 ; python_version >= '3.11' 44 | urllib3==2.0.7 ; python_version >= '3.12' # (Noble) Compatibility with cryptography 45 | vobject==0.9.6.1 46 | Werkzeug==3.0.6 ; python_version >= '3.12' # (Noble) Avoid deprecation warnings 47 | xlrd==2.0.1 ; python_version >= '3.12' 48 | XlsxWriter==3.1.9 ; python_version >= '3.12' 49 | xlwt==1.3.0 50 | zeep==4.2.1 ; python_version >= '3.11' 51 | 52 | 53 | 54 | 55 | 56 | 57 | setuptools==78.1.1 58 | 59 | # Not part of official requirements, but used by some addons 60 | # colorama==0.3.9 61 | gdata==2.0.18 62 | html5lib==1.1 63 | odfpy==1.4.1 64 | pyinotify==0.9.6 65 | simplejson==3.19.3 66 | 67 | 68 | # Migration tools 69 | marabunta==0.12.0 70 | -e git+https://github.com/camptocamp/anthem@master#egg=anthem 71 | 72 | 73 | # Library dependency 74 | argh==0.31.3 75 | atomicwrites==1.4.1 76 | attrs==24.2.0 77 | beautifulsoup4==4.12.3 78 | future==1.0.0 79 | mccabe==0.7.0 80 | more-itertools==10.4.0 81 | pbr==6.0.0 82 | pexpect==4.9.0 83 | ptyprocess==0.7.0 84 | pycodestyle==2.12.1 85 | pyflakes==3.2.0 86 | unicodecsv==0.14.1 87 | wrapt==1.16.0 88 | -------------------------------------------------------------------------------- /18.0/extra_requirements.txt: -------------------------------------------------------------------------------- 1 | # Extra python dependencies 2 | algoliasearch==4.1.1 3 | Adyen==12.3.0 4 | cachetools==5.5.0 5 | cerberus==1.3.5 6 | boto3==1.35.6 7 | factur-x==3.1 8 | invoice2data==0.4.5 9 | mailjet-rest==1.3.4 10 | openupgradelib==3.6.1 11 | paramiko==3.4.1 12 | parse-accept-language==0.1.2 13 | paypalrestsdk==1.13.3 14 | phonenumbers==8.13.44 15 | pyquerystring==1.1 16 | pyOpenSSL==24.2.1 17 | pyquerystring==1.1 18 | pysimplesoap==1.16.2 19 | requests-mock==1.12.1 20 | slugify==0.0.1 21 | stripe==10.8.0 22 | unidecode==1.3.8 23 | vcrpy==6.0.1 24 | 25 | # Library dependency 26 | asn1crypto==1.5.1 27 | bcrypt==4.2.0 28 | botocore==1.35.6 29 | cffi==1.17.0 30 | cryptography==43.0.0 31 | dateparser==1.2.0 32 | idna==3.8 33 | jmespath==1.0.1 34 | multidict==6.0.5 35 | pdfminer.six==20240706 36 | pyasn1==0.6.0 37 | pycparser==2.22 38 | pycryptodome==3.20.0 39 | PyNaCl==1.5.0 40 | pytesseract==0.3.13 41 | regex==2024.7.24 42 | s3transfer==0.10.2 43 | tzlocal==5.2 44 | Unidecode==1.3.8 45 | yarl==1.9.4 46 | 47 | #Extra for enterprise 48 | pdfminer==20191125 49 | -------------------------------------------------------------------------------- /18.0/src_requirements.txt: -------------------------------------------------------------------------------- 1 | # Requirements for the project itself and for Odoo. 2 | # When we install Odoo with -e, odoo.py is available in the PATH and 3 | # 'openerp' in the PYTHONPATH 4 | # 5 | # They are installed only after all the project's files have been copied 6 | # into the image (with ONBUILD) 7 | -e . 8 | -e src 9 | -------------------------------------------------------------------------------- /18.0/templates/odoo.cfg.tmpl: -------------------------------------------------------------------------------- 1 | [options] 2 | addons_path = {{ .Env.ADDONS_PATH }} 3 | data_dir = /odoo/data/odoo 4 | auto_reload = False 5 | db_host = {{ .Env.DB_HOST }} 6 | db_name = {{ .Env.DB_NAME }} 7 | db_user = {{ .Env.DB_USER }} 8 | db_password = {{ .Env.DB_PASSWORD }} 9 | db_sslmode = {{ default .Env.DB_SSLMODE "prefer" }} 10 | dbfilter = ^{{ default .Env.DB_FILTER .Env.DB_NAME }}$ 11 | list_db = {{ default .Env.LIST_DB "False" }} 12 | admin_passwd = {{ default .Env.ADMIN_PASSWD "" }} 13 | db_maxconn = {{ default .Env.DB_MAXCONN "64" }} 14 | limit_memory_soft = {{ default .Env.LIMIT_MEMORY_SOFT "2147483648" }} 15 | limit_memory_hard = {{ default .Env.LIMIT_MEMORY_HARD "2684354560" }} 16 | limit_request = {{ default .Env.LIMIT_REQUEST "8192" }} 17 | limit_time_cpu = {{ default .Env.LIMIT_TIME_CPU "60" }} 18 | limit_time_real = {{ default .Env.LIMIT_TIME_REAL "120" }} 19 | limit_time_real_cron = {{ default .Env.LIMIT_TIME_REAL_CRON "120" }} 20 | log_handler = {{ default .Env.LOG_HANDLER "':INFO'" }} 21 | log_level = {{ default .Env.LOG_LEVEL "info" }} 22 | max_cron_threads = {{ default .Env.MAX_CRON_THREADS "2" }} 23 | workers = {{ default .Env.WORKERS "4" }} 24 | logfile = {{ default .Env.LOGFILE "None" }} 25 | log_db = {{ default .Env.LOG_DB "False" }} 26 | logrotate = True 27 | syslog = {{ default .Env.SYSLOG "False" }} 28 | running_env = {{ default .Env.RUNNING_ENV "dev" }} 29 | without_demo = {{ default .Env.WITHOUT_DEMO "True" }} 30 | server_wide_modules = {{ default .Env.SERVER_WIDE_MODULES "" }} 31 | ; db_sslmode = 32 | ; We can activate proxy_mode even if we are not behind a proxy, because 33 | ; it is used only if HTTP_X_FORWARDED_HOST is set in environ 34 | proxy_mode = True 35 | ; csv_internal_sep = , 36 | ; db_template = template1 37 | ; debug_mode = False 38 | ; email_from = False 39 | ; http_port = 8069 40 | ; http_enable = True 41 | ; http_interface = 42 | ; longpolling_port = 8072 43 | ; osv_memory_age_limit = 1.0 44 | ; osv_memory_count_limit = False 45 | ; smtp_password = False 46 | ; smtp_port = 25 47 | ; smtp_server = localhost 48 | ; smtp_ssl = False 49 | ; smtp_user = False 50 | unaccent = {{ default .Env.UNACCENT "False" }} 51 | {{ default .Env.ADDITIONAL_ODOO_RC "" }} 52 | -------------------------------------------------------------------------------- /18.0/test_requirements.txt: -------------------------------------------------------------------------------- 1 | # test / lint 2 | # those libs and their dependencies are unpinned 3 | # to always test with the last version of it 4 | flake8 5 | pytest==8.3.2 6 | pluggy 7 | coverage 8 | pytest-odoo>=0.4.7 9 | pytest-cov>=2.10.0 10 | watchdog 11 | -------------------------------------------------------------------------------- /HISTORY.rst: -------------------------------------------------------------------------------- 1 | .. :changelog: 2 | 3 | .. Template: 4 | 5 | .. 0.0.1 (2016-05-09) 6 | .. ++++++++++++++++++ 7 | 8 | .. **Features and Improvements** 9 | 10 | * Replace environment variable OPENERP_SERVER with ODOO_RC 11 | 12 | .. **Bugfixes** 13 | 14 | .. **Libraries** 15 | 16 | .. **Build** 17 | 18 | * Change PostgreSQL deb repo to 'apt-archive' for debian stretch based images 19 | 20 | .. **Documentation** 21 | 22 | Release History 23 | --------------- 24 | 25 | 5.3.0.0.0 (2024-08-26) 26 | ++++++++++++++++++++++ 27 | 28 | **Features and Improvements** 29 | 30 | * remove pathtools library, use pathlib instead 31 | * remove 14 buster, use bookworm instead 32 | * use bookwork for all supported versions, specific debian version applied 33 | * bump all package for 15.0/16.0/17.0 34 | * swtich 15.0/16.0/17.0 to python 3.12 on bookworm 35 | 36 | 37 | 38 | 5.2.1.0.0 (2024-01-19) 39 | ++++++++++++++++++++++ 40 | 41 | **Features and Improvements** 42 | 43 | * add openxlrd library 44 | * remove 11.0 version 45 | 46 | 5.2.0.0.0 (2024-01-19) 47 | ++++++++++++++++++++++ 48 | 49 | **Features and Improvements** 50 | 51 | * add env variable for LOCAL_CODE_PATH and MIGRATION_CONFIG_FILE 52 | * /bin script to remove gosu dependencies 53 | * clean local-src reference 54 | * print DEPS_ADDONS for debugging 55 | 56 | **Bugfixes** 57 | 58 | 5.1.0.0.1 (2023-12-11) 59 | ++++++++++++++++++++++ 60 | 61 | **Bugfixes** 62 | 63 | * fix the entrypoint path in the entrypoint script 64 | 65 | 66 | 5.1.0.0.0 (2023-11-13) 67 | ++++++++++++++++++++++ 68 | 69 | **Features and Improvements** 70 | 71 | * 17.0 version 72 | * Switch to github action 73 | * Image pushed to github repository 74 | 75 | 76 | **Bugfixes** 77 | 78 | **Libraries** 79 | 80 | **Build** 81 | 82 | **Documentation** 83 | 84 | 5.1.0 (2023-11-13) move to 5.1.0.0.0 85 | ++++++++++++++++++++++++++++++++++++ 86 | 87 | **Features and Improvements** 88 | 89 | * Image pushed to github repository 90 | 91 | 92 | **Bugfixes** 93 | 94 | **Libraries** 95 | 96 | **Build** 97 | 98 | **Documentation** 99 | 100 | 5.0.8 (2023-09-12) 101 | ++++++++++++++++++ 102 | 103 | **Features and Improvements** 104 | 105 | **Bugfixes** 106 | 107 | * Remove pip install of src 108 | 109 | **Libraries** 110 | 111 | **Build** 112 | 113 | **Documentation** 114 | 115 | 5.0.7 (2023-06-07) 116 | ++++++++++++++++++ 117 | 118 | **Features and Improvements** 119 | 120 | **Bugfixes** 121 | 122 | * Fix entrypoint path for odoo 123 | 124 | **Libraries** 125 | 126 | **Build** 127 | 128 | **Documentation** 129 | 5.0.6 (2023-04-28) 130 | ++++++++++++++++++ 131 | 132 | **Features and Improvements** 133 | 134 | * Switch to buster for version 11.0 135 | 136 | **Bugfixes** 137 | 138 | **Libraries** 139 | 140 | **Build** 141 | 142 | **Documentation** 143 | 144 | 5.0.5 (2022-12-05) 145 | ++++++++++++++++++ 146 | 147 | **Features and Improvements** 148 | 149 | * Fix package version for all versions 150 | 151 | **Bugfixes** 152 | 153 | **Libraries** 154 | 155 | **Build** 156 | 157 | **Documentation** 158 | 159 | 5.0.4 (2022-11-23) 160 | ++++++++++++++++++ 161 | 162 | **Features and Improvements** 163 | 164 | * Fix for V16 pypi 165 | 166 | **Bugfixes** 167 | 168 | **Libraries** 169 | 170 | **Build** 171 | 172 | **Documentation** 173 | 174 | 5.0.3 (2022-09-01) 175 | ++++++++++++++++++ 176 | 177 | **Features and Improvements** 178 | 179 | * Fix coverage 180 | 181 | **Bugfixes** 182 | 183 | **Libraries** 184 | 185 | **Build** 186 | 187 | **Documentation** 188 | 189 | 5.0.2 (2022-08-31) 190 | ++++++++++++++++++ 191 | 192 | **Features and Improvements** 193 | 194 | * Fix path in instance dependencies 195 | 196 | **Bugfixes** 197 | 198 | **Libraries** 199 | 200 | **Build** 201 | 202 | **Documentation** 203 | 204 | 5.0.1 (2022-08-30) 205 | ++++++++++++++++++ 206 | 207 | **Features and Improvements** 208 | 209 | * Fix makefile tag 210 | 211 | **Bugfixes** 212 | 213 | **Libraries** 214 | 215 | **Build** 216 | 217 | **Documentation** 218 | 219 | 5.0.0 (2022-08-30) 220 | ++++++++++++++++++ 221 | 222 | **Features and Improvements** 223 | 224 | * Remove old version (python 2.7) 7.0/8.0/9.0/10.0 225 | * Remove Gosu.sh 226 | * Run container with odoo user 227 | 228 | **Bugfixes** 229 | 230 | **Libraries** 231 | 232 | **Build** 233 | 234 | **Documentation** 235 | 236 | 4.4.5 (2022-08-29) 237 | ++++++++++++++++++ 238 | 239 | **Features and Improvements** 240 | 241 | * Add +x on start-entrypoint.d/001_set_report_url (#192) 242 | 243 | **Bugfixes** 244 | 245 | * Pin certifi library for Odoo<=10.0 to avoid python compatibility issue 246 | 247 | **Libraries** 248 | 249 | **Build** 250 | 251 | **Documentation** 252 | 253 | 254 | 4.4.4 (2022-05-23) 255 | ++++++++++++++++++ 256 | 257 | **Features and Improvements** 258 | 259 | * Set PostgreSQL application name using hostname 260 | 261 | **Bugfixes** 262 | 263 | * Fix args unpacking in docker-entrypoint.sh 264 | * Replace deprecated URL in requirements.txt for V15 265 | * Pin contextlib2 requirement for Odoo <= V10 266 | * Add kwkhtmltopdf in test composition to avoid issues when testing reports 267 | 268 | **Libraries** 269 | 270 | **Build** 271 | 272 | **Documentation** 273 | 274 | 4.4.3 (2022-03-04) 275 | ++++++++++++++++++ 276 | 277 | **Features and Improvements** 278 | 279 | **Bugfixes** 280 | 281 | * Fix reportlab version for label 282 | 283 | **Libraries** 284 | 285 | **Build** 286 | 287 | **Documentation** 288 | 289 | 4.4.2 (2022-03-01) 290 | ++++++++++++++++++ 291 | 292 | **Features and Improvements** 293 | 294 | **Bugfixes** 295 | 296 | * Fix python3 for version 15 297 | 298 | **Libraries** 299 | 300 | **Build** 301 | 302 | **Documentation** 303 | 304 | 4.4.1 (2022-02-16) 305 | ++++++++++++++++++ 306 | 307 | **Features and Improvements** 308 | 309 | **Bugfixes** 310 | 311 | * Fix execute flag wkhtmltopdf 312 | 313 | **Libraries** 314 | 315 | **Build** 316 | 317 | **Documentation** 318 | 319 | 4.4.0 (2022-02-05) 320 | ++++++++++++++++++ 321 | 322 | **Features and Improvements** 323 | 324 | * Use kwkhtmltopdf server instead of wkhtmltopdf binary for reporting 325 | 326 | **Bugfixes** 327 | 328 | * Fix lab entry point 329 | 330 | **Libraries** 331 | 332 | **Build** 333 | 334 | **Documentation** 335 | 336 | 337 | 4.3.0 (2021-12-02) 338 | ++++++++++++++++++ 339 | 340 | **Features and Improvements** 341 | 342 | * Update marabunta to 0.10.6 343 | 344 | **Bugfixes** 345 | 346 | * [15.0] Fix bullseye src repo for postgresql 347 | * [*] Fix error NO_PUBKEY for postgres packages 348 | * [15.0] Fix python-dev version to use 3.9 as it is the default python version on bullseye 349 | * [15.0] Change bin/list_dependencies.py script to use `python3` instead of `python` as the latest does not exist on bullseye 350 | 351 | **Libraries** 352 | 353 | * [13.0-15.0] Remove python2 package python-libxslt1 354 | * [11.0-14.0] Remove obsolete feedparser package 355 | * [11.0-15.0] Fix setuptools for compat with 2to3 still in used in pinned dependencies 356 | * [12.0-15.0] Get proper wkhtml version for >= buster releases (includes bullseye) 357 | * [15.0] zeep replaces suds-jurko 358 | * [9.0,10.0] pin libraries that dropped python2.7 support (pytest-cov, watchdog and ruamel.yaml.clib) 359 | * [15.0] upgrade extra dep cffi to 1.15.0 360 | * [13.0-15.0] Bump Pillow, urllib3 and requests to fix potential security issues 361 | * [14.0,15.0] Upgrade to same Psycopg2 and Jinja2 versions 362 | * [15.0] Bump lxml to version 4.6.3 363 | * [14.0] Bump reportlab version to fix printing qr code 364 | 365 | **Build** 366 | 367 | * Add new version for Odoo 15.0 368 | * [15.0] Need docker-ce 20 instead of docker-ce 18 for building Odoo 15 on debian:bullseye 369 | * Publish images on ghcr.io 370 | 371 | **Documentation** 372 | 373 | * Document change to ghcr.io 374 | 375 | 376 | 4.2.1 (2021-05-10) 377 | ++++++++++++++++++ 378 | 379 | **Bugfixes** 380 | 381 | * switch apt url for PostgreSQL to apt-archive for jessie-based images 382 | see https://www.postgresql.org/message-id/YBMtd6nRuXyU2zS4%40msg.df7cb.de 383 | 384 | 385 | 4.2.0 (2021-04-08) 386 | ++++++++++++++++++ 387 | 388 | **Features and Improvements** 389 | 390 | * disable pip version checks (required network access, can timeout) 391 | * Bypass migration when using: 392 | 393 | docker-compose run --rm odoo odoo shell [...] 394 | docker-compose run --rm odoo odoo [...] --help [...] 395 | 396 | **Bugfixes** 397 | 398 | * [<= 10.0] Fix pytest version to 4.6, last supported version in Python 2.7 399 | * Fix dbfilter in test environment 400 | 401 | **Libraries** 402 | 403 | * Update Marabunta to 0.10.5 404 | * [14.0] Downgrade `urllib3` to a compatible version with Odoo supported `requests` version. 405 | * [>= 12.0] Remove `odoo-autodiscover` as it's not necessary since Odoo 12.0. 406 | * [11.0,12.0] Pin `watchdog` to Py3.5 compatible versions 407 | * [>= 10.0] Bump odoo requirements 408 | * Bump jinja2 to fix security issue 409 | * Bump lxml to fix security issue 410 | * Bump Pillow to fix security issue 411 | * Bump PyYAML to fix security issue 412 | * [<= 10.0] Pin `pip` to last Py2 compatible version 413 | * [<= 10.0] Pin `watchdog` to last Py2 compatible version 414 | * [<= 10.0] Pin `ruamel.yaml` to last Py2 compatible version 415 | * [<= 10.0] Pin `importlib-metadata` to last Py2 compatible version 416 | * [<= 10.0] Pin `zipp` to last Py2 compatible version 417 | 418 | **Build** 419 | 420 | * Add new version for Odoo 14.0 421 | * Add new 12.0 flavor based on debian:buster 422 | 423 | **Documentation** 424 | 425 | * pytest-cov documentation 426 | 427 | 428 | 4.1.0 (2020-05-05) 429 | ++++++++++++++++++ 430 | 431 | **Features and Improvements** 432 | 433 | * Add support for socket connection to PostgreSQL 434 | 435 | **Bugfixes** 436 | 437 | * Pin `setuptools<45` and other dependencies to ensure Python 2 support in Odoo<=10 438 | * Fix deprecated download links for wkhtmltopdf 439 | * Include `.coveragerc` for all versions 440 | * Fix PostgreSQL package installation in v13 441 | 442 | **Libraries** 443 | 444 | * Bump `psutil` version to 5.7.0 445 | * Bump `Pillow` version to 6.2.2 (v9-13) 446 | * Bump various libraries in v13 to match Odoo's requirements 447 | 448 | 449 | 4.0.0 (2019-12-23) 450 | ++++++++++++++++++ 451 | 452 | **Features and Improvements** 453 | 454 | * Add support for additional Odoo configuration parameters with environment variable `ADDITIONAL_ODOO_RC` 455 | 456 | **Bugfixes** 457 | 458 | * Use user `odoo` instead of `root` when running tests and coverage 459 | **! Warning !** Because of this change, the file previously `/.coverage` is now in `/home/odoo/.coverage` 460 | 461 | **Libraries** 462 | 463 | * Bump `Jinja2` version to 2.10.1 464 | * Bump `urllib3` version to 1.24.2 465 | * Bump `wkhtmltopdf` version to 0.12.5.1 (for odoo 12 only) 466 | * Bump `werkzeug` version to 0.16.0 (v9-13) 467 | * Bump `werkzeug` version to 0.9.6 (v7-8) 468 | * Bump various libraries to get rid of security alerts (v7+8 only) 469 | * Bump `Pillow` version to 6.2.0 (v9-13) 470 | * Bump `Pillow` version to 3.4.2 (v7-8) 471 | * Bump `anthem` version to 0.13.0 472 | 473 | **Build** 474 | 475 | * Add images for versions 7 & 8 (check Legacy Images section in documentation) 476 | 477 | 478 | 3.1.2 (2019-03-27) 479 | ++++++++++++++++++ 480 | 481 | .. DANGER:: Breaking changes 482 | 483 | Marabunta: 484 | * `install_command` and `install_args` options are now all merged into `install_command` 485 | Please update your migration.yml and docker-compose files accordingly. 486 | See https://github.com/camptocamp/marabunta/blob/master/HISTORY.rst#0100-2018-11-06 487 | for more information 488 | 489 | **Libraries** 490 | 491 | * Update marabunta to have fixed marabunta_serie 492 | 493 | **Build** 494 | 495 | * Pin PyYAML to 4.2b4 496 | * Unpin pip on all images 497 | 498 | 499 | 3.1.1 (2019-01-09) 500 | ++++++++++++++++++ 501 | 502 | **Bugfixes** 503 | 504 | * Remove the NO_DATABASE_LIST option, does not exist, the sole option is DB_LIST 505 | 506 | **Libraries** 507 | 508 | * Bump `requests` version 509 | * Remove duplicated `magento` dependency 510 | * Bump `PyYAML` version for CVE-2017-18342 511 | * Remove bad copy of extra_requirements in Dockerfile 512 | 513 | * Must be done only in batteries flavor (see Dockerfile-batteries) 514 | 515 | 516 | 3.1.0 (2018-10-19) 517 | ++++++++++++++++++ 518 | 519 | **Features and Improvements** 520 | 521 | * Launch tests only once 522 | 523 | **Bugfixes** 524 | 525 | * Fix Travis build, batteries overriding normal build 526 | * Fix broken build chain 527 | * Fix BEFORE_MIGRATE_ENTRYPOINT_DIR & START_ENTRYPOINT_DIR to remove /odoo 528 | 529 | **Libraries** 530 | 531 | * Adapt requirements for system and python 3.5 532 | * Bump paramiko version 533 | * Unfreeze pluggy version 534 | 535 | **Build** 536 | 537 | * Change latest docker tag to 11.0 538 | * Use setup version for marabunta in example 539 | * Add coveragerc in working directory 540 | 541 | **Support of 12.0** 542 | 543 | * Copy settings from 11.0 to 12.0 544 | * Rename package odoo file for odoo v12 545 | * Copy v12 requirements from odoo requirements 546 | * Add version 12.0 in travis.yml 547 | * Temporary fix test waiting Odoo release 12.0 548 | * Remove useless install of pip from github in version 12.0 549 | 550 | 551 | 3.0.0 (2018-09-07) 552 | ++++++++++++++++++ 553 | 554 | .. DANGER:: Breaking changes 555 | 556 | Flavors: you have either to use the ``onbuild`` flavor, either to add the 557 | ``COPY`` instructions in your projects Dockerfiles. 558 | 559 | Directories have been re-arranged, you must adapt addons-path, volumes or COPY instructions: 560 | 561 | * /opt/odoo/etc/odoo.cfg.tmpl → /templates/odoo.cfg.tmpl 562 | * /opt/odoo/etc/odoo.cfg → /etc/odoo.cfg 563 | * /opt/odoo → /odoo 564 | * /opt/odoo/bin → /odoo-bin 565 | * /opt/odoo/bin_compat → /odoo-bin-compat (for 9.0) 566 | * /opt/odoo/before-migrate-entrypoint.d → /before-migrate-entrypoint.d 567 | * /opt/odoo/start-entrypoint.d → /start-entrypoint.d 568 | 569 | Marabunta: 570 | 571 | * 1st version is now "setup" 572 | * Support of 5 digits versions (11.0.1.2.3), consistent with Odoo addons 573 | See 574 | https://github.com/camptocamp/marabunta/blob/master/HISTORY.rst#090-2018-09-04 575 | for more information 576 | 577 | 578 | **Features and Improvements** 579 | 580 | * Refactor code to be able to share code between versions (see common and bin directories) 581 | * Introduce Flavors of the image: 582 | 583 | * normal image without "onbuild" 584 | * normal image with "onbuild" instructions 585 | * batteries-included image without "onbuild" 586 | * batteries-included with "onbuild" instructions 587 | 588 | * Batteries-included flavor includes a selected list of python packages commonly used in OCA addons (see extra_requirements.txt) 589 | * Do not use the "latest" image, pick your flavor after you read the readme 590 | * Python build package are now available in the variable $BUILD_PACKAGE 591 | * New script to install and remove all build package (see install/dev_package.sh and install/purge_dev_package_and_cache.sh) from $BUILD_PACKAGE 592 | * Change directory organisation. Move /opt/odoo/etc => /opt/etc, /opt/odoo/bin => /opt/bin. So now you can mount the whole odoo directory from your dev environment (instead of directory by directory) 593 | * Adapt example with the previous change 594 | * Helpers for running tests on cached databases / preinstalled addons 595 | 596 | **Libraries** 597 | 598 | * Update marabunta to 0.9.0 (https://github.com/camptocamp/marabunta/blob/master/HISTORY.rst#090-2018-09-04) 599 | * Update `cryptography` dependency to a newer version as security vulnerability was found in the one we used 600 | 601 | 602 | 2.7.0 (2018-07-27) 603 | ++++++++++++++++++ 604 | 605 | This is the last release before 3.0.0, which will provide different flavors 606 | if the image, without onbuild instructions, with onbuild and full. 607 | 608 | **Features and Improvements** 609 | 610 | * Allow to set the odoo's unaccent option with the environment variable UNACCENT 611 | in order to use the PostgreSQL extension 'unaccent' 612 | * ``ODOO_REPORT_URL`` is now ``http://localhost:8069`` by default 613 | 614 | **Bugfixes** 615 | 616 | * Fix error with python3/pip (ImportError: cannot import name 'main') 617 | 618 | **Libraries** 619 | 620 | * Upgrade python libs; either to the version in odoo's requirements.txt, either 621 | to a more recent version if there is no breaking change. It should fix a few 622 | potential security issues. 623 | 624 | 625 | 2.6.1 (2018-03-29) 626 | ++++++++++++++++++ 627 | 628 | **Bugfixes** 629 | 630 | * Fix permission issue when running 'runtests' if odoo-bin has no executable flag 631 | 632 | 633 | 2.6.0 (2018-03-29) 634 | ++++++++++++++++++ 635 | 636 | **Features and Improvements** 637 | 638 | * Add Script to set report.url if provided. 639 | * The http_proxy environment variable will be honored by 'gpg' when reaching the 640 | key for the gosu key. 641 | * With the new version of anthem, CSV files can be loaded from a relative path 642 | (starting from /opt/odoo/data): https://github.com/camptocamp/anthem/pull/36 643 | * The runtests script shows the coverage at the end 644 | 645 | **Build** 646 | 647 | * Upgrade setuptools, otherwise the pip installs fail with 648 | NameError: name 'platform_system' is not defined 649 | * Disable pip cache directory to reduce image size 650 | 651 | **Libraries** 652 | 653 | * Upgrade six to 1.10.0 654 | * Upgrade ``anthem`` to 0.11.0 in every odoo version 655 | * Upgrade ``marabunta`` to 0.8.0 in every odoo version 656 | * Install the ``phonenumbers`` library for odoo 11.0 657 | 658 | 659 | 2.5.1 (2018-01-11) 660 | ++++++++++++++++++ 661 | 662 | **Build** 663 | 664 | * Reduce size of the 11.0 image by cleaning and optimizing layers 665 | 666 | 2.5.0 (2018-01-11) 667 | ++++++++++++++++++ 668 | 669 | **Features and Improvements** 670 | 671 | * Add an Odoo 11.0 image version. Which required upgrading dependencies to 672 | Python 3 for this image. 673 | 674 | **Libraries** 675 | 676 | * Upgrade pip to the development version, to prevent unnecessary upgrades of libs 677 | * Upgrade ``anthem`` to 0.11.0 678 | * Upgrade ``marabunta`` to 0.8.0 679 | 680 | **Build** 681 | 682 | * Upgrade gosu to 1.10 683 | * Upgrade dockerize to 0.6.0 and run a checksum 684 | 685 | 686 | 2.4.1 (2017-11-01) 687 | ++++++++++++++++++ 688 | 689 | **Libraries** 690 | 691 | * Upgrade ``marabunta`` to 0.7.3, includes a bugfix for postgresql passwords 692 | with special chars 693 | 694 | 695 | 2.4.0 (2017-09-20) 696 | ++++++++++++++++++ 697 | 698 | **Features and Improvements** 699 | 700 | * A maintenance page is published on the same port than Odoo (8069) during the 701 | marabunta migration (need anthem >= 0.10.0 and marabunta >= 0.7.2) 702 | * Support installation of Odoo addons packaged as Python wheels 703 | 704 | **Bugfixes** 705 | 706 | * The ``start-entrypoint./000_base_url`` script might fail when we don't run 707 | marabunta migration and the database does not exist, the script is now 708 | ignored in such case. 709 | 710 | **Libraries** 711 | 712 | * Upgrade ``anthem`` to 0.10.0 713 | * Upgrade ``marabunta`` to 0.7.2, includes a maintenance page during the upgrade! 714 | * Add ``odoo-autodiscover>=2.0.0b1`` to support Odoo addons packaged as wheels 715 | * Upgrade ``psycopg2`` to 2.7.3.1 with several bugfixes notably "Fixed 716 | inconsistent state in externally closed connections" in 717 | http://initd.org/psycopg/articles/2017/07/22/psycopg-272-released/ 718 | 719 | 720 | 2.3.0 (2017-07-05) 721 | ++++++++++++++++++ 722 | 723 | **Features and Improvements** 724 | 725 | * Remove ``DOMAIN_NAME`` environment variable. Only ``ODOO_BASE_URL`` is now used. 726 | * Set a default value for ``ODOO_BASE_URL`` to ``http://localhost:8069``. 727 | 728 | **Libraries** 729 | 730 | * Add ``ofxparse`` as found in odoo's requirements 731 | * Upgrade ``psycopg2`` to 2.7.1 732 | * Add ``pytest-cov`` for tests 733 | * PyChart is no longer installed from gna.org (down) but from pypi 734 | 735 | 736 | 2.2.0 (2017-05-18) 737 | ++++++++++++++++++ 738 | 739 | **Features and Improvements** 740 | 741 | * Upgrade postgres-client to 9.6 742 | * Add before-migrate-entrypoint.d, same principle than the start-entrypoint.d 743 | but run before the migration 744 | 745 | 746 | 2.1.1 (2017-05-04) 747 | ++++++++++++++++++ 748 | 749 | **Bugfixes** 750 | 751 | * Remove a remaining occurence of hardcoded 'db' host in the start-entrypoint 752 | that set the base URL. 753 | 754 | 755 | 2.1.0 (2017-04-28) 756 | ++++++++++++++++++ 757 | 758 | **Features and Improvements** 759 | 760 | * Possibility to change the hostname for database with ``$DB_HOST`` (default is ``db``) 761 | * Set the ``list_db`` option to ``False`` by default. This option can be 762 | unsafe and there is no reason to activate it as the image is designed to run 763 | on one database by default. 764 | * New option in configuration file replacing ``--load``: ``server_wide_modules`` can 765 | be configured with the environment variable ``SERVER_WIDE_MODULES`` 766 | 767 | **Libraries** 768 | 769 | * Upgrade ``anthem`` to 0.7.0 770 | * Upgrade ``dockerize`` to 0.4.0 771 | * Add ``html2text`` (used in ``mail`` module) 772 | * Add ``odfpy`` and ``xlrd`` for xls/xlsx/ods imports 773 | 774 | 775 | 2.0.0 (2016-12-22) 776 | ++++++++++++++++++ 777 | 778 | **Warning** 779 | 780 | This release might break compatibility with the images using it, it needs some 781 | little modifications in their ``Dockerfile``. 782 | The Workdir of the container will be ``/opt`` instead of ``/opt/odoo``. 783 | The reason is that it allows a more natural transition between the project from 784 | the outside of the container and from the inside. Meaning, if we run the following command: 785 | 786 | :: 787 | 788 | docker-compose run --rm -e DB_NAME=dbtest odoo pytest -s odoo/local-src/my_addon/tests/test_feature.py::TestFeature::test_it_passes 789 | 790 | The path ``odoo/local-src...`` is the path you see in your local project (with auto-completion), 791 | but it is valid from inside the container too. 792 | 793 | The implication is that the projects' Dockerfile need to be adapted, for instance: 794 | 795 | :: 796 | 797 | COPY ./requirements.txt ./ 798 | RUN pip install -r requirements.txt 799 | COPY ./importer.sh bin/ 800 | 801 | becomes: 802 | 803 | :: 804 | 805 | COPY ./requirements.txt /opt/odoo/ 806 | RUN cd /opt/odoo && pip install -r requirements.txt 807 | 808 | COPY ./importer.sh /opt/odoo/bin/ 809 | 810 | 811 | **Features and Improvements** 812 | 813 | * Include pytest 814 | * Add testdb-gen, command that generates a test database to be used with pytest 815 | * Add testdb-update, command to update the addons of a database created with testdb-gen 816 | * 'chown' is executed on the volumes only if the user is different, should make the boot faster 817 | * 'chown' is executed for any command, not only when starting odoo, needed to run testdb-gen 818 | * Customizable ``web.base.url`` with environment variables ``ODOO_BASE_URL`` or 819 | ``DOMAIN_NAME`` 820 | * Allow to run custom scripts between ``migrate`` and the execution of 821 | ``odoo``, by placing them in ``/opt/odoo/start-entrypoint.d`` (respecting 822 | ``run-parts`` naming rules) 823 | 824 | **Libraries** 825 | 826 | * Upgrade marabunta to 0.6.3 (https://github.com/camptocamp/marabunta/releases/tag/0.6.3) 827 | 828 | 829 | 1.7.1 (2016-11-25) 830 | ++++++++++++++++++ 831 | 832 | Important bugfix in marabunta! The changes in the ``marabunta_version`` were 833 | never committed, so migration would run again. 834 | 835 | **Libraries** 836 | 837 | * Upgrade Marabunta to 0.6.1 838 | 839 | 840 | 1.7.0 (2016-11-21) 841 | ++++++++++++++++++ 842 | 843 | **Features and Improvements** 844 | 845 | * Export PG* environment variables for convenience, so in a shell we can connect 846 | on the current database with: 847 | 848 | ``docker-compose run --rm odoo psql -l`` 849 | 850 | And in Marabunta steps we can execute SQL files with: 851 | 852 | ``psql -f path/to/file.sql`` 853 | 854 | Instead of: 855 | 856 | ``sh -c 'PGPASSWORD=$DB_PASSWORD psql -h db -U $DB_USER -f path/to/file.sql $DB_NAME'`` 857 | 858 | * Use unbuffer when calling marabunta, to have the output line by line 859 | 860 | **Bugfixes** 861 | 862 | * Change 'pip list' invocation to remove a deprecation warning 863 | 864 | **Libraries** 865 | 866 | * Upgrade marabunta to 0.6.0 (https://github.com/camptocamp/marabunta/releases/tag/0.6.0) 867 | 868 | 869 | 1.6.2 (2016-10-26) 870 | ++++++++++++++++++ 871 | 872 | **Bugfixes** 873 | 874 | * Set default command to 'odoo' for 9.0 as well 875 | * Run migration if the command is odoo.py too 876 | 877 | **Libraries** 878 | 879 | * Upgrade marabunta to 0.5.1 880 | 881 | 1.6.1 (2016-10-24) 882 | ++++++++++++++++++ 883 | 884 | **Bugfixes** 885 | 886 | * ``runtests`` was calling the wrong path for ``odoo`` in 9.0 version 887 | 888 | **Build** 889 | 890 | * Tests on Travis call ``runtests`` during the build to ensure the script works 891 | as expected 892 | 893 | 894 | 1.6.0 (2016-10-12) 895 | ++++++++++++++++++ 896 | 897 | **New Odoo 10.0 image** 898 | 899 | Now, images for Odoo 10.0 and 9.0 are generated. 900 | The versioning is still the same, note that 9.0 and 10.0 share the final 901 | part of their version: 902 | 903 | - ``camptocamp/odoo-project:9.0-latest`` 904 | - ``camptocamp/odoo-project:9.0-1.6.0`` 905 | - ``camptocamp/odoo-project:10.0-latest`` 906 | - ``camptocamp/odoo-project:10.0-1.6.0`` 907 | 908 | Images are no longer built on hub.docker.com but tested on Travis and pushed 909 | when the test is green. 910 | The test consists of the example project being built and Odoo started. 911 | 912 | Images should be built using ``make`` now. The ``bin`` folder at the root of the 913 | repository is copied into the folders before the builds, so it is common to 914 | both versions. 915 | 916 | **Changes in the Odoo 9.0 image** 917 | 918 | A new command ``odoo`` has been added in the path and ``exec``-utes ``odoo.py``. 919 | This is to ensure the compatibility of the various scripts as ``odoo.py`` has 920 | been renamed to ``odoo`` in Odoo 10.0. 921 | 922 | **Libraries** 923 | 924 | * Anthem upgraded to 0.5.0 (Odoo 10.0 support) 925 | * Marabunta upgraded to 0.5.0 (Odoo 10.0 support) 926 | * XlsxWriter added in 9.0 as it becomes required in Odoo 10.0 and required for 927 | the OCA QWeb accounting reports 928 | 929 | 930 | 1.5.0 (2016-09-28) 931 | ++++++++++++++++++ 932 | 933 | **Possibly breaking change** 934 | 935 | * Now the default user id for the filestore will be 999 instead of 9001. It 936 | should not be problematic in most cases because the volumes are `chown`-ed in 937 | the entrypoint. But you have to be cautious if you have interactions with 938 | host volumes or other containers. 939 | 940 | 941 | 1.4.0 (2016-09-23) 942 | ++++++++++++++++++ 943 | 944 | **Features and Improvements** 945 | 946 | * Add a 'lint' command that calls flake8 on the local sources 947 | 948 | **Bugfixes** 949 | 950 | * Make the database user own the created database 951 | 952 | **Libraries** 953 | 954 | * Upgrade requests to 2.6.0 (same version defined in odoo's requirements.txt) 955 | 956 | 1.3.0 (2016-08-19) 957 | ++++++++++++++++++ 958 | 959 | **Bugfixes** 960 | 961 | * Create /data/odoo{addons,filestore,sessions} folders at container's start, 962 | which sometimes prevent Odoo to start at the first boot 963 | 964 | **Libraries** 965 | 966 | * Upgrade to Marabunta 0.4.2 (https://github.com/camptocamp/marabunta/releases/tag/0.4.2) 967 | * Upgrade to Anthem 0.4.0 (https://github.com/camptocamp/anthem/releases/tag/0.4.0) 968 | 969 | 1.2.1 (2016-07-27) 970 | ++++++++++++++++++ 971 | 972 | **Libraries** 973 | 974 | * Upgrade to Marabunta 0.4.1 (https://github.com/camptocamp/marabunta/releases/tag/0.4.1) 975 | 976 | 1.2.0 (2016-07-26) 977 | ++++++++++++++++++ 978 | 979 | **Libraries** 980 | 981 | * Upgrade to Marabunta 0.4.0 (https://github.com/camptocamp/marabunta/releases/tag/0.4.0) 982 | * Upgrade to Anthem 0.3.0 (https://github.com/camptocamp/anthem/releases/tag/0.3.0) 983 | 984 | 1.1.0 (2016-07-22) 985 | ++++++++++++++++++ 986 | 987 | **Features and Improvements** 988 | 989 | * Add environment variable `MIGRATE` which allow to disable migration when 990 | launching the container. 991 | 992 | **Libraries** 993 | 994 | * Upgrade to Anthem 0.2.0 995 | 996 | 1.0.3 (2016-07-13) 997 | ++++++++++++++++++ 998 | 999 | **Fixes** 1000 | 1001 | * Fix error ``pkg_resources.DistributionNotFound: odoo==9.0c`` happening at the 1002 | start of the container when we use a host volume for the odoo's src. 1003 | 1004 | 1.0.2 (2016-07-12) 1005 | ++++++++++++++++++ 1006 | 1007 | **Fixes** 1008 | 1009 | * Fix ``DEMO=True`` wrongly displaying "Running without demo data" instead of 1010 | "with" (but the demo data was loaded) 1011 | * Upgrade to Marabunta 0.3.3 which resolves an unicode encode error on output 1012 | 1013 | 1.0.1 (2016-07-08) 1014 | ++++++++++++++++++ 1015 | 1016 | * Upgrade to Marabunta 0.3.2 1017 | 1018 | 1.0.0 (2016-07-08) 1019 | ++++++++++++++++++ 1020 | 1021 | The docker image for Odoo 9.0 is `camptocamp/odoo-project:9.0-1.0.0` 1022 | 1023 | This release is not backward compatible, it drops ``oerpscenario``. 1024 | 1025 | **Changes** 1026 | 1027 | * Drop ``oerpscenario`` which will no longer maintained. 1028 | * ``marabunta`` (https://github.com/camptocamp/marabunta) is now called on 1029 | startup to automatically apply the migrations scripts for new versions. 1030 | * ``anthem`` (https://github.com/camptocamp/anthem) is added to write the 1031 | migration scripts. 1032 | * The ``odoo`` directory is now a (local) Python package, so we can use 1033 | ``pkg_resources`` to find files. 1034 | * Python packages are now installed from ``pip`` instead of Debian packages 1035 | * ``pip install -e src`` is called to install Odoo, so ``odoo.py`` and ``import 1036 | openerp`` are widely available without having to resort on ``PATH`` 1037 | modifications. 1038 | * The ``DEMO`` environment variable now only accepts ``True`` or ``False``, 1039 | loading demo data from scenario (anthem songs) should be done using 1040 | ``MARABUNTA_MODE=``. It allows to have an unlimited number of 1041 | different scenario (demo, light, full, or whatever) 1042 | * ``SCENARIO_MAIN_TAG`` has no effect 1043 | 1044 | **Instructions for migration of your project** 1045 | 1046 | New files / directory to add in the ``odoo`` directory: 1047 | 1048 | * Directory ``songs/``, which is used to store the ``anthem`` songs (upgrade scripts) 1049 | * File ``setup.py``, used to make a Python package from the project's 1050 | directory, allowing to find data and songs for the migrations 1051 | 1052 | :: 1053 | 1054 | # -*- coding: utf-8 -*- 1055 | 1056 | from setuptools import setup, find_packages 1057 | 1058 | with open('VERSION') as fd: 1059 | version = fd.read().strip() 1060 | 1061 | setup( 1062 | name="project-name", 1063 | version=version, 1064 | description="project description", 1065 | license='GNU Affero General Public License v3 or later (AGPLv3+)', 1066 | author="Author...", 1067 | author_email="email...", 1068 | url="url...", 1069 | packages=['songs'] + ['songs.%s' % p for p in find_packages('./songs')], 1070 | include_package_data=True, 1071 | classifiers=[ 1072 | 'Development Status :: 4 - Beta', 1073 | 'License :: OSI Approved', 1074 | 'License :: OSI Approved :: ' 1075 | 'GNU Affero General Public License v3 or later (AGPLv3+)', 1076 | 'Programming Language :: Python', 1077 | 'Programming Language :: Python :: 2', 1078 | 'Programming Language :: Python :: 2.7', 1079 | 'Programming Language :: Python :: Implementation :: CPython', 1080 | ], 1081 | ) 1082 | 1083 | * ``VERSION`` contains the current version number, such as ``9.1.0``. 1084 | 1085 | * ``migration.yml`` is the ``marabunta``'s manifest file, example: 1086 | 1087 | :: 1088 | 1089 | migration: 1090 | options: 1091 | install_command: odoo.py 1092 | versions: 1093 | - version: 9.0.0 1094 | operations: 1095 | pre: 1096 | - "sh -c 'PGPASSWORD=$DB_PASSWORD psql -h db -U $DB_USER -c \"CREATE EXTENSION pg_trgm;" $DB_NAME'" 1097 | post: 1098 | - anthem songs.install.base::main 1099 | addons: 1100 | upgrade: 1101 | - sale 1102 | - document 1103 | - version: 9.1.0 1104 | addons: 1105 | upgrade: 1106 | - stock 1107 | 1108 | 1109 | * If you use ``DEMO=odoo``, you should replace it with ``DEMO=True`` 1110 | * If you use ``DEMO=scenario``, you should remove the variable and use 1111 | ``MARABUNTA_MODE=demo`` 1112 | * If you use ``DEMO=all``, you should replace it with ``DEMO=True`` and add 1113 | ``MARABUNTA_MODE=demo`` 1114 | 1115 | * If you use ``oerpscenario`` in your project, you should plan to replace it by 1116 | ``anthem``. In the meantime, you need to add it in your project: 1117 | 1118 | :: 1119 | 1120 | $ git submodule add https://github.com/camptocamp/oerpscenario.git odoo/oerpscenario 1121 | $ mkdir -p odoo/bin 1122 | $ wget https://raw.githubusercontent.com/camptocamp/docker-odoo-project/c9a2afcf8152e5323cc49c919443602c54c839fd/9.0/bin/oerpscenario -O odoo/bin/oerpscenario 1123 | $ chmod +x odoo/bin/oerpscenario 1124 | 1125 | 1126 | And in your local Dockerfile, add the following lines: 1127 | 1128 | :: 1129 | 1130 | COPY oerpscenario /opt/odoo/oerpscenario 1131 | COPY bin/oerpscenario /opt/odoo/bin/oerpscenario 1132 | 1133 | 1134 | Then, add call to ``oerpscenario`` in the ``marabunta``'s ``migration.yml`` operations. 1135 | 1136 | :: 1137 | 1138 | migration: 1139 | versions: 1140 | - version: 9.0.0 1141 | operations: 1142 | post: 1143 | - oerpscenario -t my-project-tag 1144 | 1145 | 9.0 1146 | +++ 1147 | 1148 | Initial release of the Docker Odoo Project image. 1149 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | ifndef VERSION 2 | VERSION=15.0 3 | endif 4 | 5 | IMAGE_LATEST=ci-5xx-latest:${VERSION} 6 | BUILD_TAG=$(IMAGE_LATEST) 7 | 8 | export 9 | 10 | .PHONY: all 11 | all: 12 | bash build.sh 13 | 14 | .PHONY: setup 15 | setup: 16 | bash setup.sh 17 | 18 | 19 | .PHONY: test 20 | test: 21 | bash test.sh 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![Build Status](https://app.travis-ci.com/camptocamp/docker-odoo-project.svg?branch=master)](https://app.travis-ci.com/camptocamp/docker-odoo-project) 2 | 3 | # docker-odoo-project 4 | 5 | A base image for our Odoo projects. 6 | 7 | This image alone does nothing because it doesn't contain any Odoo's code. The 8 | code should be added in a Dockerfile inheriting from this image. 9 | 10 | A project using this image has to respect a defined structure, look at the [example](example). 11 | 12 | See also the [Changelog](HISTORY.rst). 13 | 14 | ## ⚠️ Version 5.0.0 : Some Breaking changes 15 | - We not longer use gosu 16 | - The `odoo` user is created during the build of the image, and no longer in the entrypoint 17 | - All odoo related files are moved in /odoo 18 | - odoo runs with uid 999; if you need to change this, use for instance `docker-compose --build-arg UID=$(id -u) 19 | - Odoo versions 7.0, 8.0, 9.0 and 10.0 are no longer supported 20 | 21 | ## ⚠️ Reporting now use kwkhtmltopdf instead of wkhtmltopdf 22 | 23 | To limit the amount of memory required on each containers to print report 24 | 25 | We have switch to kwkhtmltopdf project : https://github.com/acsone/kwkhtmltopdf 26 | 27 | the kwkhtmltopdf client is included in the base image, you must set the 28 | env variable : 29 | 30 | KWKHTMLTOPDF_SERVER_URL=: 31 | 32 | and you also need to specify report url to let kwkhtmltopdf server to retrive images/header etc... from odoo: 33 | 34 | ODOO_REPORT_URL= 35 | 36 | ## ⚠️ Images moved to ghcr.io 37 | 38 | Due to pull limitation on docker.io the images are now pushed exclusively on ghcr.io. 39 | 40 | Images can be found under the github link "Packages". 41 | https://github.com/camptocamp/docker-odoo-project/pkgs/container/odoo-project 42 | 43 | ## Image Flavors 44 | 45 | There are 4 flavors of the image: 46 | 47 | - normal: `odoo-project:${odoo_version}-${tag_version}` 48 | 49 | Note: in production, we strongly recommend to never use the "latest" tag. 50 | Instead use a specific version in order to be able to rebuild identical images. 51 | 52 | 53 | ## Build 54 | 55 | The images should be build with `make`: 56 | 57 | Normal flavors: 58 | 59 | ``` 60 | # generate image camptocamp/odoo-project:11.0-latest and camptocamp/odoo-project:11.0-latest 61 | $ make VERSION=11.0 62 | # generate image camptocamp/odoo-project:10.0-latest and camptocamp/odoo-project:10.0-latest 63 | $ make VERSION=10.0 64 | ``` 65 | 66 | ## Configuration 67 | 68 | The host for the database is in `$DB_HOST` (`db` by default). 69 | 70 | A volume `/data/odoo` is declared, which is expected to contain Odoo's filestore 71 | (this path is set in `openerp.cfg`). 72 | 73 | Ports 8069 and 8072 are exposed by default. 74 | 75 | ## Environment variables 76 | 77 | ### ODOO_BASE_URL 78 | 79 | The `ir.config_parameter` `web.base.url` will be automatically set to this 80 | domain when the container starts. `web.base.url.freeze` will be set to `True`. 81 | Default url is `http://localhost:8069`. If `ODOO_BASE_URL` is set to an empty 82 | value, the configuration parameters will be left unchanged. 83 | 84 | ### ODOO_REPORT_URL 85 | 86 | The `ir.config_parameter` `report.url` will be automatically set to this 87 | domain when the container starts.. 88 | Default url is `http://localhost:8069`. As soon as we use kwkhtmltopdf 89 | we must set this URL to be accessible by you kwkhtmltopdf server 90 | 91 | ### KWKHTMLTOPDF_SERVER_URL 92 | 93 | It point to the server that host the kwktmltopdf server to serve files 94 | 95 | 96 | ### MIGRATE 97 | 98 | `MIGRATE` can be `True` or `False` and determines whether migration tool 99 | marabunta will be launched. By default migration will be launched. 100 | 101 | Migration is *not* launched when using: 102 | 103 | ``` 104 | docker-compose run --rm odoo odoo shell [...] 105 | docker-compose run --rm odoo odoo [...] --help [...] 106 | ``` 107 | 108 | ### MARABUNTA_MODE 109 | 110 | In [Marabunta](https://github.com/camptocamp/marabunta) versions, you can 111 | declare additional execution modes, such as `demo` or `full` in order to choose 112 | which operations and addons are executed for a migration. 113 | 114 | A typical use case would be: 115 | 116 | * Install the set of addons in the base mode (the base mode is always executed) 117 | * Load an excerpt of the data in the `demo` mode, used for test instances 118 | * Load the complete dataset in the `full` mode, used for the integration and 119 | production servers 120 | 121 | On the test server, you would set `MARABUNTA_MODE=demo` and on the production 122 | one `MARABUNTA_MODE=full`. 123 | 124 | ### MARABUNTA_ALLOW_SERIE 125 | 126 | By default, [Marabunta](https://github.com/camptocamp/marabunta) does not allow 127 | to execute more than one version upgrade at a time. This is because it is 128 | dangerous to execute a migration script (say 9.1.0) if the version of the code 129 | is not the same (say 9.2.0). 130 | 131 | For a production server, it works, because usually you only want to upgrade to 132 | the last version N from N-1. But for development or a test server, you might 133 | want to take the risk of running all the migration scripts consecutively, this 134 | is what `MARABUNTA_ALLOW_SERIE=True` is for. 135 | 136 | ### MARABUNTA_FORCE_VERSION 137 | 138 | When you are developing / testing migrations with 139 | [Marabunta](https://github.com/camptocamp/marabunta), you can force the upgrade 140 | of a specific version with `MARABUNTA_FORCE_VERSION=`. 141 | 142 | ### ODOO_DATA_PATH 143 | 144 | Specifies path of data folder where to put base setup data for your project. 145 | In `anthem` songs this allows you to pass relative paths 146 | instead of recovering the full path via module resource paths. 147 | More precisely, if you set this var you can skip this in your songs: 148 | 149 | ``` 150 | from pkg_resources import Requirement, resource_stream 151 | 152 | req = Requirement.parse('my-odoo') 153 | 154 | 155 | def load_csv(ctx, path, model, delimiter=',', 156 | header=None, header_exclude=None): 157 | content = resource_stream(req, path) 158 | load_csv(ctx, content, ...) 159 | ``` 160 | 161 | and use `anthem` loader straight:: 162 | 163 | ``` 164 | from anthem.lyrics.loaders import load_csv 165 | 166 | load_csv('relative/path/to/file', ...) 167 | ``` 168 | 169 | NOTE: `anthem > 0.11.0` is required. 170 | 171 | ### LOCAL_CODE_PATH 172 | 173 | Specifies path for local(custom) code to be used, by default is /odoo/odoo/addons 174 | 175 | ### MIGRATION_CONFIG_FILE 176 | 177 | Specifies path for migration config file, by default is /odoo/migration.yml 178 | 179 | ### DEMO 180 | 181 | `DEMO` can be `True` or `False` and determines whether Odoo will load its Demo 182 | data. It has effect only at the creation of the database. 183 | 184 | ### User id 185 | 186 | By default, the user ID inside of the container will be 999. There is little 187 | concern with this ID until we setup a host volume: the same user ID will be 188 | used to write the files on the host's filesystem. 999 will probably be 189 | inexistent on the host system but at least it will not collide with an actual 190 | user. 191 | 192 | If you need you can make an image that inherit from this one and made 193 | an alter user odoo -u your udi 194 | 195 | ### CREATE_DB_CACHE 196 | 197 | Used in `bin/runtests` and `bin/runmigration`. 198 | 199 | If set to "true", will create a dump in `.cachedb` of an intermediate state of the tests or migration. 200 | By default not set, thus unactivated. 201 | 202 | ### LOAD_DB_CACHE 203 | 204 | Used in `bin/runtests` and `bin/runmigration`. 205 | 206 | If set to "false", will skip trying to reload a cached dump from `.cachedb`. 207 | 208 | ### SUBS_MD5 209 | 210 | This value is used in `bin/runtests` to determine the name of the intermediate state to 211 | load or create. 212 | 213 | Value to tag a database dump of `bin/runtests`, for instance it can be based on 214 | submodules in .travis.yml of your git repositories in odoo/src and in odoo/external-src: 215 | 216 | ``` 217 | export SUBS_MD5=$(git submodule status | md5sum | cut -d ' ' -f1) 218 | ``` 219 | 220 | You want this value to be unique and identify your dependencies, thus if a 221 | dependency change you need to generate a new one. 222 | 223 | ### MIG_LOAD_VERSION_CEIL 224 | 225 | Used in `bin/runmigration` to specify from which dump we want to play the migration. 226 | In case you have a dump per version, you can play the migration against the version of your choice. 227 | If the version specified does not exists, it will search for a lower occurence. 228 | 229 | It will load a dump lower than "odoo_sample_$MIG_LOAD_VERSION_CEIL.dmp" 230 | This is useful if you bumped odoo/VERSION as it won't match existing 231 | dumps. 232 | 233 | For instance you have made a dump 10.1.0, you are now on the version 234 | 10.2.0, if you pass your current version it will search for a dump 235 | lower than 10.2.0 and restore the 10.1.0. Then play the remaining 236 | steps on top of it. 237 | 238 | ### Odoo Configuration Options 239 | 240 | The main configuration options of Odoo can be configured through environment variables. The name of the environment variables are the same of the options but uppercased (eg. `workers` becomes `WORKERS`). 241 | 242 | Look in [11.0/templates/odoo.cfg.tmpl](11.0/templates/odoo.cfg.tmpl) to see the full list. 243 | 244 | While most of the variables can be set in the docker-compose file so we can have different values for different environments, the `ADDONS_PATH` **must** be set in the `Dockerfile` of your project with a line such as: 245 | 246 | ``` 247 | ENV ADDONS_PATH=/odoo/local-src,/odoo/external-src/server-tools,/odoo/src/addons 248 | ``` 249 | 250 | By setting this value in the `Dockerfile`, it will be integrated into the build and thus will be consistent across each environment. 251 | 252 | By the way, you can add other `ENV` variables in your project's `Dockerfile` if you want to customize the default values of some variables for a project. 253 | 254 | You can also use environment variable `ADDITIONAL_ODOO_RC` for any additional parameters that must go in the `odoo.cfg` file. 255 | e.g.: 256 | ``` 257 | ADDITIONAL_ODOO_RC=" 258 | custom_param=42 259 | other_param='some value' 260 | " 261 | ``` 262 | 263 | 264 | ## Running tests 265 | 266 | ### runtests 267 | 268 | Inside the container, a script `runtests` is used for running the tests on Travis. 269 | 270 | Unless `LOAD_DB_CACHE is set to `false` it will search for a dump of dependencies and restore it. 271 | Otherwise, will create a new database, find the `odoo/external-src` and `odoo/src` dependencies of the local addons and 272 | if `CREATE_DB_CACHE` is activated creates a dump of that state. 273 | 274 | Then it will install local addons, run their tests and show the code coverage. 275 | 276 | ``` 277 | docker-compose run --rm [-e CREATE_DB_CACHE=true] [-e LOAD_DB_CACHE=false] [-e SUBS_MD5=] odoo runtests 278 | ``` 279 | 280 | 281 | This is not the day-to-day tool for running the tests as a developer. 282 | 283 | ### pytests 284 | 285 | pytest is included and can be invoked when starting a container. It needs an existing database to run the tests: 286 | 287 | ``` 288 | docker-compose run --rm -e DB_NAME=testdb odoo testdb-gen -i my_addon 289 | docker-compose run --rm -e DB_NAME=testdb odoo pytest -s odoo/local-src/my_addon/tests/test_feature.py::TestFeature::test_it_passes 290 | ``` 291 | 292 | When you make changes in the addon, you need to update it in Odoo before running the tests again. You can use: 293 | 294 | ``` 295 | docker-compose run --rm -e DB_NAME=testdb odoo testdb-update -u my_addon 296 | ``` 297 | 298 | When you are done, you can drop the database with: 299 | 300 | ``` 301 | docker-compose run --rm odoo dropdb testdb 302 | ``` 303 | 304 | 305 | Pytest uses a plugin (https://github.com/camptocamp/pytest-odoo) that corrects the 306 | Odoo namespaces (`openerp.addons`/`odoo.addons`) when running the tests. 307 | 308 | ### pytest-cov 309 | 310 | pytest-cov is also included and can be used to generate a coverage report. 311 | You can add --cov=MODULE_PATH to your pytest to get a text version in the shell, or export it as HTML so you can browse the results. 312 | To export it to HTML, add --cov-report=HTML:EXPORT_PATH 313 | 314 | ### runmigration 315 | 316 | Inside the container, a script `runmigration` is used to run the migration steps on Travis. 317 | 318 | Then when launched, it will search for database dump of the content of `odoo/VERSION` file. 319 | Or if you provided `MIG_LOAD_VERSION_CEIL` which will allow you to search for an other version. 320 | If no dump is available (or `LOAD_DB_CACHE` is set to `false`), migration will start from scratch. 321 | 322 | The migration steps are then run. 323 | 324 | If migration succeed a dump is created if `CREATE_DB_CACHE` is set to `true`. 325 | 326 | ``` 327 | docker-compose run --rm [-e CREATE_DB_CACHE=true] [-e LOAD_DB_CACHE=false] [-e MIG_LOAD_VERSION_CEIL=x.y.z] odoo runmigration 328 | ``` 329 | 330 | This tools really speed up the process of testing migration steps as you can be executing only a single step instead of redoing all. 331 | 332 | ### cached dumps (runtests / runmigration) 333 | 334 | To use database dumps you will need a volume on `/.cachedb` to have persistant dumps. 335 | 336 | On travis you will also want to activate the cache, if your volume definition is `- "$HOME/.cachedb:/.cachedb"` 337 | add this in `.travis.yml`: 338 | 339 | ``` 340 | cache: 341 | directories: 342 | - $HOME/.cachedb 343 | ``` 344 | 345 | ## Start entrypoint 346 | 347 | Any script in any language placed in `/start-entrypoint.d` will be 348 | executed just between the migration and the start of Odoo. 349 | Similarly, scripts placed in `/before-migrate-entrypoint.d` will be 350 | executed just before the migration. 351 | 352 | The order of execution of the files is determined by the `run-parts` 's rules. 353 | You can add your own scripts in those directories. They must be named 354 | something like `010_abc` (`^[a-zA-Z0-9_-]+$`) and must have no extension (or 355 | it would not be picked up by `run-parts`). 356 | 357 | Important: The database is guaranteed to exist when the scripts are run, so you 358 | must take that in account when writing them. Usually you'll want to use such 359 | check: 360 | 361 | ``` 362 | if [ "$( psql -tAc "SELECT 1 FROM pg_database WHERE datname='$DB_NAME'" )" != '1' ] 363 | then 364 | echo "Database does not exist, ignoring script" 365 | exit 0 366 | fi 367 | ``` 368 | 369 | The scripts are run only if the command is `odoo`/`odoo.py`. 370 | 371 | ## Legacy images 372 | 373 | Legacy images are used for projects using deprecated Odoo versions (7 & 8). 374 | They work the same as the newer ones, with a few differences. 375 | 376 | ### Anthem 377 | 378 | `anthem` is not available in these images as the Odoo API is too old to use it. 379 | If you want to script migration parts, you can write a script using `erppeek`. 380 | 381 | Sidenote: You can still use SQL scripts the same as before 382 | 383 | ### Demo Data 384 | 385 | In Odoo 8, the configuration parameter `without_demo` can be sometimes buggy (Odoo will still install demo data even if it is told not to do so). 386 | 387 | To circumvent this behavior, you can force this parameter in the command line used to start Odoo (check [migration.yml](example/odoo/migration.yml) as example). 388 | -------------------------------------------------------------------------------- /before-migrate-entrypoint.d/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/camptocamp/docker-odoo-project/159992a9cc1ac4a1715ee4f7f8e9e714b7b78d98/before-migrate-entrypoint.d/.gitkeep -------------------------------------------------------------------------------- /bin/check_package: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | cat /odoo/base_requirements.txt > requirements.txt 6 | 7 | sed -i '/^\s*$/d' requirements.txt 8 | 9 | pip freeze -r requirements.txt | grep -v odoo > installed_package.txt 10 | 11 | sed -i '/^\s*$/d' installed_package.txt 12 | 13 | if head -n -1 installed_package.txt | grep -Fq "The following requirements were added by pip freeze:" 14 | then 15 | echo "Some python library have been installed but there are not listed in the requirements, please fix it" 16 | cat installed_package.txt 17 | exit 1 18 | else 19 | sed -i '$ d' installed_package.txt 20 | diff installed_package.txt requirements.txt > requirements.diff 21 | if [ -s requirements.diff ] 22 | then 23 | echo "You have some diff in your requirement, maybe some version are not freeze" 24 | cat requirements.diff 25 | else 26 | echo "Package are correctly frozen" 27 | fi 28 | fi 29 | -------------------------------------------------------------------------------- /bin/docker-entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | # Display the user_id used by odoo 5 | echo "Starting with UID : $(id -u)" 6 | 7 | export PGHOST=${DB_HOST} 8 | export PGPORT=${DB_PORT} 9 | export PGUSER=${DB_USER} 10 | export PGDATABASE=${DB_NAME} 11 | export PGAPPNAME=${HOSTNAME} 12 | 13 | # As docker-compose exec do not launch the entrypoint 14 | # init PG variable into .bashrc so it will be initialized 15 | # when doing docker-compose exec odoo odoo bash 16 | echo " 17 | export PGHOST=${DB_HOST} 18 | export PGPORT=${DB_PORT} 19 | export PGUSER=${DB_USER} 20 | export PGDATABASE=${DB_NAME} 21 | export PGAPPNAME=${HOSTNAME} 22 | " >>/odoo/.bashrc 23 | 24 | # Only set PGPASSWORD if there is no .pgpass file 25 | if [ ! -f /odoo/.pgpass ]; then 26 | export PGPASSWORD=${DB_PASSWORD} 27 | echo " 28 | export PGPASSWORD=${DB_PASSWORD} 29 | " >>/odoo/.bashrc 30 | fi 31 | 32 | # Accepted values for DEMO: True / False 33 | # Odoo use a reverse boolean for the demo, which is not handy, 34 | # that's why we propose DEMO which exports WITHOUT_DEMO used in 35 | # openerp.cfg.tmpl 36 | if [ -z "$DEMO" ]; then 37 | DEMO=False 38 | fi 39 | case "$(echo "${DEMO}" | tr '[:upper:]' '[:lower:]')" in 40 | "false") 41 | echo "Running without demo data" 42 | export WITHOUT_DEMO=all 43 | ;; 44 | "true") 45 | echo "Running with demo data" 46 | export WITHOUT_DEMO= 47 | ;; 48 | # deprecated options: 49 | "odoo") 50 | echo "Running with demo data" 51 | echo "DEMO=odoo is deprecated, use DEMO=True" 52 | export WITHOUT_DEMO= 53 | ;; 54 | "none") 55 | echo "Running without demo data" 56 | echo "DEMO=none is deprecated, use DEMO=False" 57 | export WITHOUT_DEMO=all 58 | ;; 59 | "scenario") 60 | echo "DEMO=scenario is deprecated, use DEMO=False and MARABUNTA_MODE=demo with a demo mode in migration.yml" 61 | exit 1 62 | ;; 63 | "all") 64 | echo "DEMO=all is deprecated, use DEMO=True and MARABUNTA_MODE=demo with a demo mode in migration.yml" 65 | exit 1 66 | ;; 67 | *) 68 | echo "Value '${DEMO}' for DEMO is not a valid value in 'False', 'True'" 69 | exit 1 70 | ;; 71 | esac 72 | 73 | # Create configuration file from the template 74 | TEMPLATES_DIR=/templates 75 | CONFIG_TARGET=/tmp/odoo.cfg 76 | if [ -e $TEMPLATES_DIR/openerp.cfg.tmpl ]; then 77 | dockerize -template $TEMPLATES_DIR/openerp.cfg.tmpl:$CONFIG_TARGET 78 | fi 79 | if [ -e $TEMPLATES_DIR/odoo.cfg.tmpl ]; then 80 | dockerize -template $TEMPLATES_DIR/odoo.cfg.tmpl:$CONFIG_TARGET 81 | fi 82 | cat $CONFIG_TARGET | grep -v '^#' | grep -v '^$' > /odoo/odoo.cfg 83 | if [ ! -f "${CONFIG_TARGET}" ]; then 84 | echo "Error: one of /templates/openerp.cfg.tmpl, /templates/odoo.cfg.tmpl, /etc/odoo.cfg is required" 85 | exit 1 86 | fi 87 | 88 | # Wait until postgres is up 89 | wait_postgres.sh 90 | 91 | BASE_CMD=$(basename $1) 92 | CMD_ARRAY=($*) 93 | ARGS=(${CMD_ARRAY[@]:1}) 94 | 95 | if [ "$BASE_CMD" = "odoo" ] || [ "$BASE_CMD" = "odoo.py" ] || [ "$BASE_CMD" = "migrate" ]; then 96 | BEFORE_MIGRATE_ENTRYPOINT_DIR=/odoo/before-migrate-entrypoint.d 97 | if [ -d "$BEFORE_MIGRATE_ENTRYPOINT_DIR" ]; then 98 | run-parts --verbose "$BEFORE_MIGRATE_ENTRYPOINT_DIR" 99 | fi 100 | fi 101 | if [ "$BASE_CMD" = "odoo" ] || [ "$BASE_CMD" = "odoo.py" ]; then 102 | 103 | # Bypass migrate when `odoo shell` or `odoo --help` are used 104 | if [[ ! " ${ARGS[@]} " =~ " --help " ]] && [[ ! " ${ARGS[@]:0:1} " =~ " shell " ]]; then 105 | 106 | if [ -z "$MIGRATE" -o "$MIGRATE" = True ]; then 107 | migrate 108 | fi 109 | 110 | fi 111 | 112 | START_ENTRYPOINT_DIR=/odoo/start-entrypoint.d 113 | if [ -d "$START_ENTRYPOINT_DIR" ]; then 114 | run-parts --verbose "$START_ENTRYPOINT_DIR" 115 | fi 116 | 117 | exec "$@" 118 | fi 119 | 120 | exec "$@" 121 | -------------------------------------------------------------------------------- /bin/lint: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | flake8 $LOCAL_CODE_PATH --exclude=__init__.py 5 | -------------------------------------------------------------------------------- /bin/list_dependencies.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | # Provide a list of module which are dependencies 4 | # of odoo/addons modules excluding odoo/addons modules 5 | # 6 | # Arguments: 7 | # list of module (coma separated), restrict list of 8 | # dependencies to the dependencies of this list. 9 | # 10 | # Usage: 11 | # ./odoo/bin/list_dependencies.py local_module1,local_module2 12 | import sys 13 | import os 14 | import ast 15 | 16 | LOCAL_CODE_PATH = os.getenv('LOCAL_CODE_PATH',"/odoo/odoo/addons") 17 | 18 | dependencies = set() 19 | local_modules = os.listdir(LOCAL_CODE_PATH) 20 | if len(sys.argv) > 1: 21 | modules = sys.argv[1].split(",") 22 | else: 23 | modules = local_modules 24 | for mod in modules: 25 | # read __manifest__ 26 | manifest_path = os.path.join(LOCAL_CODE_PATH, mod, "__manifest__.py") 27 | if not os.path.isfile(manifest_path): 28 | continue 29 | with open(manifest_path) as manifest: 30 | data = ast.literal_eval(manifest.read()) 31 | dependencies.update(data["depends"]) 32 | 33 | # remove local-src from list of dependencies 34 | dependencies = dependencies.difference(local_modules) 35 | print(",".join(dependencies) or "base") 36 | -------------------------------------------------------------------------------- /bin/migrate: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | if ! PGPASSWORD=$DB_PASSWORD psql -lqtA -h $DB_HOST -U $DB_USER | grep -q "^$DB_NAME|"; then 5 | PGPASSWORD=$DB_PASSWORD createdb -h $DB_HOST -U $DB_USER -O $DB_USER $DB_NAME 6 | fi 7 | MARABUNTA_DB_HOST=$DB_HOST \ 8 | MARABUNTA_DATABASE=$DB_NAME \ 9 | MARABUNTA_DB_USER=$DB_USER \ 10 | MARABUNTA_DB_PASSWORD=$DB_PASSWORD \ 11 | MARABUNTA_DB_PORT=$DB_PORT \ 12 | unbuffer marabunta --migration-file $MIGRATION_CONFIG_FILE 13 | -------------------------------------------------------------------------------- /bin/runmigration: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Run marabunta steps 4 | # 5 | # Mainly used from Travis, 6 | # 7 | # If a cached dump of previous version is found, restore it. 8 | # Then play remaining marabunta steps from this state. 9 | # 10 | # Otherwise install from scratch. 11 | # 12 | # And finally make a database dump if none exists for current VERSION. 13 | # 14 | # TODO: store cache on S3 to store one DB per version 15 | # 16 | # Environment variables: 17 | # 18 | # CREATE_DB_CACHE: 19 | # if set to "true", will create a dump named "odoo_sample_$VERSION.dmp" 20 | # 21 | # LOAD_DB_CACHE: 22 | # if set to "false", will skip trying to reload cached dump named "odoo_sample_$VERSION.dmp" 23 | # 24 | # MIG_LOAD_VERSION_CEIL: 25 | # Version number passed to search for an older dump. 26 | # 27 | # It will load a dump lower than "odoo_sample_$MIG_LOAD_VERSION_CEIL.dmp" 28 | # This is useful if you bumped odoo/VERSION as it won't match existing 29 | # dumps. 30 | # 31 | # For instance you have made a dump 10.1.0, you are now on the version 32 | # 10.2.0, if you pass your current version it will search for a dump 33 | # lower than 10.2.0 and restore the 10.1.0. Then play the remaining 34 | # steps on top of it. 35 | set -e 36 | 37 | wait_postgres.sh 38 | CACHE_DIR=${CACHE_DIR:=/tmp/cachedb} 39 | 40 | echo $CACHE_DIR 41 | 42 | VERSION=$(cat /odoo/VERSION) 43 | 44 | CACHED_DUMP="$CACHE_DIR/odoo_sample_$VERSION.dmp" 45 | 46 | if [ "$LOAD_DB_CACHE" != "false" ]; then 47 | 48 | # If we want to run the migration steps on top of a previous dump 49 | # useful when odoo/VERSION was edited 50 | if [ -n "$MIG_LOAD_VERSION_CEIL" ]; then 51 | echo "New version - Searching for previous version dump 🔭" 52 | if [ -d "$CACHE_DIR" ]; then 53 | # Filter dumps of higher releases 54 | export MAX_DUMP="$CACHE_DIR/odoo_sample_${MIG_LOAD_VERSION_CEIL}.dmp" 55 | CACHED_DUMP=$(ls -v $CACHE_DIR/odoo_sample_*.dmp | awk '$0 < ENVIRON["MAX_DUMP"]' | tail -n1) 56 | else 57 | echo "No cached migration sample dump found" 58 | fi 59 | fi 60 | else 61 | echo "Dump cache load disabled." 62 | fi 63 | 64 | if [ "$LOAD_DB_CACHE" != "false" -a -f "$CACHED_DUMP" ]; then 65 | echo "🐘 🐘 Database dump ${CACHED_DUMP} found 🐘 🐘" 66 | echo "Restore Database dump from cache 📦⮕ 🐘" 67 | createdb -O $DB_USER $DB_NAME 68 | psql -q -o /dev/null -f "$CACHED_DUMP" 69 | echo "Do migration on top of restored dump" 70 | else 71 | echo "Do migration from scratch 🐢 🐢 🐢" 72 | fi 73 | 74 | migrate 75 | 76 | # Create a dump if none exist for the current VERSION 77 | if [ "$CREATE_DB_CACHE" == "true" -a ! -f "$CACHED_DUMP" ]; then 78 | echo "Save DB to cache $CACHED_DUMP 🐘⮕ 📦" 79 | mkdir -p "$CACHE_DIR" 80 | pg_dump -Fp -O -f "$CACHED_DUMP" 81 | ls -l $CACHED_DUMP 82 | fi 83 | -------------------------------------------------------------------------------- /bin/runtests: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Run unit tests of odoo/addons modules 4 | # 5 | # mainly used from Travis, 6 | # it creates a database, 7 | # if a cached dump of official and oca modules exists restore it 8 | # otherwise install dependencies and create a dump to cache 9 | # then install local addons 10 | # runs tests on it and drops it. 11 | # 12 | # Arguments: 13 | # optional: name of the addons to test, separated by , 14 | # 15 | # Environment variables: 16 | # 17 | # CREATE_DB_CACHE: 18 | # if set to "true", will create a dump named "odoo_test_$VERSION.dmp" 19 | # 20 | # LOAD_DB_CACHE: 21 | # if set to "false", will skip trying to reload cached dump named "odoo_test_$VERSION.dmp" 22 | # 23 | # SUBS_MD5: 24 | # value to tag the database dump. Will search for a dump named 25 | # "odoo_test_$SUBS_MD5.dmp" if not found it will create one. 26 | # 27 | set -e 28 | 29 | # TODO: if we are not in TRAVIS, make a template then run tests on a copy 30 | 31 | wait_postgres.sh 32 | 33 | CACHE_DIR=${CACHE_DIR:=/tmp/cachedb} 34 | 35 | if [ -z $1 ]; then 36 | LOCAL_ADDONS=$(find ${LOCAL_CODE_PATH}/* -maxdepth 0 -type d -and -not -name server_environment_files -printf "%f\n" | 37 | awk -vORS=, '{print $1}' | 38 | sed 's/,$/\n/') 39 | else 40 | LOCAL_ADDONS=$1 41 | fi 42 | 43 | DEPS_ADDONS=$(list_dependencies.py "$LOCAL_ADDONS") 44 | 45 | DB_NAME_TEST=${DB_NAME}_test 46 | 47 | echo "Create database" 48 | createdb -O $DB_USER ${DB_NAME_TEST} 49 | 50 | if [[ ! -z "$SUBS_MD5" ]]; then 51 | CACHED_DUMP="$CACHE_DIR/odoo_test_$SUBS_MD5.dmp" 52 | fi 53 | 54 | echo "Submodule addons MD5 is: $SUBS_MD5" 55 | 56 | if [ "$LOAD_DB_CACHE" != "false" -a -f "$CACHED_DUMP" ]; then 57 | echo "🐘 🐘 Database dump ${CACHED_DUMP} found 🐘 🐘" 58 | echo "Restore Database dump from cache matching MD5 📦⮕ 🐘" 59 | psql -q -o /dev/null -d $DB_NAME_TEST -f "$CACHED_DUMP" 60 | psql -d $DB_NAME_TEST -P pager=off -c "SELECT name as installed_module FROM ir_module_module WHERE state = 'installed' ORDER BY name" 61 | else 62 | if [ "$LOAD_DB_CACHE" == "false" ]; then 63 | echo "Dump cache load disabled." 64 | else 65 | echo "No cached dump found matching MD5 🐢 🐢 🐢" 66 | fi 67 | echo "🔨🔨 Install official/OCA modules 🔨🔨" 68 | echo "${DEPS_ADDONS}" 69 | odoo --stop-after-init --workers=0 --database $DB_NAME_TEST --log-level=warn --without-demo="" --db-filter=$DB_NAME_TEST -i ${DEPS_ADDONS} 70 | if [ "$CREATE_DB_CACHE" == "true" -a ! -z "$CACHED_DUMP" ]; then 71 | echo "Generate dump $CACHED_DUMP into cache 🐘⮕ 📦" 72 | mkdir -p "$CACHE_DIR" 73 | pg_dump -Fp -d $DB_NAME_TEST -O -f "$CACHED_DUMP" 74 | fi 75 | fi 76 | echo "🔧🔧 Install odoo/addons modules 🔧🔧" 77 | odoo --stop-after-init --workers=0 --database $DB_NAME_TEST --test-enable --log-level=test --log-handler=":INFO" --without-demo="" --db-filter=$DB_NAME_TEST -i ${LOCAL_ADDONS} 78 | 79 | dropdb ${DB_NAME_TEST} 80 | -------------------------------------------------------------------------------- /bin/testdb-gen: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Generate a test database 4 | # 5 | # Usage: 6 | # 7 | # testdb-gen -i my_addon_to_install 8 | # 9 | 10 | set -e 11 | 12 | if psql -lqtA -h ${DB_HOST} | grep -q "^$DB_NAME|"; then 13 | echo "database ${DB_NAME} already exists" 14 | exit 1 15 | fi 16 | 17 | echo "creating database ${DB_NAME}" 18 | createdb -h ${DB_HOST} -O ${DB_USER} ${DB_NAME} 19 | odoo --stop-after-init --workers=0 --log-level=warn --without-demo="" "$@" 20 | echo "done" 21 | -------------------------------------------------------------------------------- /bin/testdb-update: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Run updates of addons on an existing test database 4 | # 5 | # Usage: 6 | # 7 | # testdb-update -u my_addon 8 | # 9 | 10 | set -e 11 | 12 | if ! psql -lqtA -h ${DB_HOST} | grep -q "^$DB_NAME|"; then 13 | echo "database ${DB_NAME} does not exist" 14 | exit 1 15 | fi 16 | 17 | echo "updating database ${DB_NAME}" 18 | odoo --stop-after-init --workers=0 --log-level=warn --without-demo="" "$@" 19 | echo "done" 20 | -------------------------------------------------------------------------------- /bin/wait_postgres.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Wait until postgresql is running. 4 | # 5 | set -e 6 | 7 | if [[ -d $DB_HOST ]]; then 8 | dockerize -timeout 30s -wait unix://${DB_HOST}/.s.PGSQL.${DB_PORT} 9 | else 10 | dockerize -timeout 30s -wait tcp://${DB_HOST}:${DB_PORT} 11 | fi 12 | 13 | # now the port is up but sometimes postgres is not totally ready yet: 14 | # 'createdb: could not connect to database template1: FATAL: the database system is starting up' 15 | # we retry if we get this error 16 | 17 | while [ "$(PGPASSWORD=$DB_PASSWORD psql -h ${DB_HOST} -U $DB_USER -c '' postgres 2>&1)" = "psql: FATAL: the database system is starting up" ] 18 | do 19 | echo "Waiting for the database system to start up" 20 | sleep 0.1 21 | done 22 | -------------------------------------------------------------------------------- /build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -exo pipefail 3 | if [ -z "$VERSION" ]; then 4 | export VERSION=15.0 5 | fi 6 | if [ -z "$BUILD_TAG" ]; then 7 | export BUILD_TAG=odoo:15.0 8 | fi 9 | 10 | # 11 | # Build the image 12 | # 13 | # Normally run by the Makefile: 14 | # 15 | # $ make VERSION=$VERSION build 16 | # 17 | # It expects the following variables to be set: 18 | # 19 | # * VERSION (9.0, 10.0, 11.0, ...) 20 | # * BUILD_TAG (tag of the 'latest' image built) 21 | # * DOCKERFILE (name of the file used for the Docker build) 22 | # 23 | if [ -z "$VERSION" ]; then 24 | echo "VERSION environment variable is missing" 25 | exit 1 26 | fi 27 | 28 | TMP=$(mktemp -d) 29 | echo "Working in $TMP" 30 | 31 | on_exit() { 32 | echo "Cleaning up temporary directory..." 33 | rm -rf $TMP 34 | rm -f /tmp/odoo.tar.gz 35 | } 36 | 37 | trap on_exit EXIT 38 | 39 | cp -r ${VERSION}/. ${TMP}/ 40 | cp -r bin/ ${TMP} 41 | cp -r install/ ${TMP} 42 | cp -r start-entrypoint.d/ ${TMP} 43 | cp -r before-migrate-entrypoint.d/ ${TMP} 44 | 45 | docker build --progress plain --no-cache -f ${TMP}/Dockerfile -t ${BUILD_TAG} ${TMP} 46 | -------------------------------------------------------------------------------- /example/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM camptocamp/odoo-project:11.0-latest 2 | MAINTAINER Camptocamp 3 | 4 | # For installing odoo you have two possibility 5 | # 1. either adding the whole root directory 6 | #COPY . /odoo 7 | 8 | # 2. or adding each directory, this solution will reduce the build and download 9 | # time of the image on the server (layers are reused) 10 | RUN mkdir -p /odoo/src/odoo 11 | COPY ./odoo/src/odoo /odoo/src/odoo 12 | COPY ./odoo/addons /odoo/odoo/addons 13 | COPY ./data /odoo/data 14 | COPY ./songs /odoo/songs 15 | COPY ./setup.py /odoo/ 16 | COPY ./VERSION /odoo/ 17 | COPY ./migration.yml /odoo/ 18 | USER root 19 | # RUN apt-get update \ 20 | # && apt-get install -y --no-install-recommends parallel libsasl2-dev libldap2-dev libssl-dev libmagic1 libpq-dev build-essential python3-dev libffi-dev pkg-config libcairo2-dev libgirepository1.0-dev\ 21 | # && apt-get clean \ 22 | # && rm -rf /var/lib/apt/lists/* 23 | 24 | # RUN set -x; \ 25 | # apt-get update \ 26 | # && apt-get install -y --no-install-recommends \ 27 | # python3-shapely \ 28 | # && apt-get clean \ 29 | # && rm -rf /var/lib/apt/lists/* 30 | 31 | COPY ./requirements.txt /odoo/ 32 | USER odoo 33 | WORKDIR /odoo 34 | # run in a virtualenv 35 | RUN /odoo/.venv/bin/pip install -r requirements.txt 36 | #RUN /odoo/.venv/bin/pip install -r /odoo/src/odoo/requirements.txt 37 | RUN /odoo/.venv/bin/pip install -e /odoo/src/odoo 38 | 39 | # Project's specifics packages 40 | 41 | ENV ADDONS_PATH=/odoo/odoo/addons,/odoo/src/odoo/addons 42 | 43 | -------------------------------------------------------------------------------- /example/README.md: -------------------------------------------------------------------------------- 1 | # Odoo Project Example 2 | 3 | The base images does nothing alone, it only contains the dependencies and a few 4 | tools, but you need to create an inheriting image with the odoo and addons 5 | code. 6 | 7 | Follow the steps: 8 | 9 | 1. Create directories. This is mandatory, they will be copied in the image 10 | 11 | mkdir -p odoo/addons data songs 12 | 13 | 2. Add a submodule for Odoo (official or OCA/OCB) 14 | 15 | git submodule init 16 | git submodule add git@github.com:odoo/odoo.git odoo/src 17 | 18 | 3. Optionally add submodules for external addons in `odoo/external-src` 19 | 20 | git submodule add git@github.com:OCA/server-tools.git odoo/external-src/server-tools 21 | 22 | 4. Optionally add custom addons in `odoo/addons` 23 | 24 | 6. Create the Dockerfile, the bare minimum being (see also [the example 25 | file](Dockerfile) that installs additional dependencies): 26 | 27 | FROM camptocamp/odoo-project:11.0 28 | MAINTAINER 29 | 30 | ENV ADDONS_PATH=/odoo/odoo/addons,/odoo/external-src/server-tools,/odoo/src/odoo/addons 31 | 32 | 7. Build your image 33 | 34 | docker build -t youruser/odoo-project-example . 35 | 36 | 8. Optionally create a [docker-compose.yml](docker-compose.yml) file. This 37 | example is a development composition. 38 | -------------------------------------------------------------------------------- /example/data/images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/camptocamp/docker-odoo-project/159992a9cc1ac4a1715ee4f7f8e9e714b7b78d98/example/data/images/logo.png -------------------------------------------------------------------------------- /example/docker-compose.yml: -------------------------------------------------------------------------------- 1 | # Composition for development 2 | 3 | version: '2' 4 | 5 | services: 6 | odoo: 7 | tty: true 8 | stdin_open: true 9 | build: ./odoo 10 | ports: 11 | - 8069 12 | depends_on: 13 | - db 14 | volumes: 15 | - "data-odoo:/data/odoo" 16 | - "data-odoo-pytest-cache:/odoo/.cache" 17 | # to speed build of image customise your .dockerignore (this is an help there) 18 | - "./odoo/src/odoo:/odoo/src/odoo/odoo" 19 | - "./odoo/src/addons:/odoo/src/odoo/addons" 20 | environment: 21 | - DB_USER=odoo 22 | - DB_PASS=odoo 23 | - DB_NAME=odoodb 24 | - ADMIN_PASSWD=# set me 25 | - RUNNING_ENV=dev 26 | - LOG_HANDLER=:WARN 27 | - LOCAL_CODE_PATH=/odoo/odoo/addons 28 | - MARABUNTA_MODE=demo # could be 'full' for the db with all the data 29 | - MARABUNTA_ALLOW_SERIE=True # should not be set in production 30 | 31 | db: 32 | image: postgres:9.6 33 | ports: 34 | - 5432 35 | environment: 36 | - POSTGRES_USER=odoo 37 | - POSTGRES_PASSWORD=odoo 38 | volumes: 39 | - "data-db:/var/lib/postgresql/data" 40 | 41 | # can be useful for dev when longpolling is required 42 | nginx: 43 | image: camptocamp/odoo-nginx:11.0-1.3.0 44 | ports: 45 | - 80:80 46 | depends_on: 47 | - odoo 48 | 49 | volumes: 50 | data-odoo: 51 | data-db: # store pytest cache, allowing to use --lf or --ff (replay last or first failures) 52 | 53 | data-odoo-pytest-cache: 54 | -------------------------------------------------------------------------------- /example/migration.yml: -------------------------------------------------------------------------------- 1 | migration: 2 | options: 3 | install_command: odoo --without-demo=${WITHOUT_DEMO:-True} 4 | versions: 5 | - version: setup 6 | operations: 7 | pre: 8 | - "sh -c 'psql -c \"CREATE EXTENSION pg_trgm;\"'" 9 | addons: 10 | upgrade: 11 | - sale 12 | -------------------------------------------------------------------------------- /example/odoo/.dockerignore: -------------------------------------------------------------------------------- 1 | **/.git/**/* 2 | **/.git 3 | **/.gitignore 4 | **/.travis.yml 5 | **/LICENSE 6 | **/*.pyc 7 | **/README.md 8 | 9 | # for speeding build of image in dev, you can build a light image 10 | # without all odoo code source by ignoring the following directory 11 | # just uncomment following lines 12 | # local-src/**/* 13 | # external-src/**/* 14 | # src/addons 15 | -------------------------------------------------------------------------------- /example/odoo/VERSION: -------------------------------------------------------------------------------- 1 | 11.0.0 2 | -------------------------------------------------------------------------------- /example/odoo/addons/README.md: -------------------------------------------------------------------------------- 1 | Here you should have your local addons, committed in this repository. 2 | -------------------------------------------------------------------------------- /example/odoo/addons/dummy_test/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | -------------------------------------------------------------------------------- /example/odoo/addons/dummy_test/__manifest__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | {'name': 'Dummy Test', 3 | 'description': "Dummy module to check that Travis runs tests. ", 4 | 'version': '1.0', 5 | 'author': 'Camptocamp', 6 | 'license': 'AGPL-3', 7 | 'category': 'Others', 8 | 'depends': ['base', 9 | ], 10 | 'website': 'http://www.camptocamp.com', 11 | 'data': [], 12 | 'installable': True, 13 | } 14 | -------------------------------------------------------------------------------- /example/odoo/addons/dummy_test/tests/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | from . import test_dummy 4 | -------------------------------------------------------------------------------- /example/odoo/addons/dummy_test/tests/test_dummy.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | import unittest 4 | 5 | 6 | class TestDummy(unittest.TestCase): 7 | 8 | def test_dummy(self): 9 | """ Dummy test to verify that tests run """ 10 | self.assertTrue(True) 11 | -------------------------------------------------------------------------------- /example/odoo/setup.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | from setuptools import setup, find_packages 4 | 5 | with open('VERSION') as fd: 6 | version = fd.read().strip() 7 | 8 | setup( 9 | name="my-project-name", 10 | version=version, 11 | description="project description", 12 | license='GNU Affero General Public License v3 or later (AGPLv3+)', 13 | author="Author...", 14 | author_email="email...", 15 | url="url...", 16 | packages=['songs'] + ['songs.%s' % p for p in find_packages('./songs')], 17 | include_package_data=True, 18 | classifiers=[ 19 | 'Development Status :: 4 - Beta', 20 | 'License :: OSI Approved', 21 | 'License :: OSI Approved :: ' 22 | 'GNU Affero General Public License v3 or later (AGPLv3+)', 23 | 'Programming Language :: Python', 24 | 'Programming Language :: Python :: 2', 25 | 'Programming Language :: Python :: 2.7', 26 | 'Programming Language :: Python :: Implementation :: CPython', 27 | ], 28 | ) 29 | -------------------------------------------------------------------------------- /example/odoo/src/README.md: -------------------------------------------------------------------------------- 1 | Here you should have Odoo's code as submodule 2 | -------------------------------------------------------------------------------- /example/pyproject.toml: -------------------------------------------------------------------------------- 1 | [build-system] 2 | requires=['setuptools-odoo', 'wheel', "setuptools>=67.0"] 3 | 4 | [tool.black] 5 | line-length = 88 6 | skip-string-normalization = 'True' 7 | include = '\.pyi?$' 8 | exclude = ''' 9 | /( 10 | \.git 11 | | \.mypy_cache 12 | | \.tox 13 | | \.venv 14 | | src/odoo 15 | | src/enterprise 16 | | odoo/paid-modules 17 | | data 18 | )/ 19 | | /__openerp__.py 20 | | /__manifest__.py 21 | ''' 22 | -------------------------------------------------------------------------------- /example/requirements.txt: -------------------------------------------------------------------------------- 1 | # project's packages, customize for your needs: 2 | unidecode==0.4.14 3 | setuptools-odoo 4 | wheel 5 | -------------------------------------------------------------------------------- /example/setup.py: -------------------------------------------------------------------------------- 1 | from setuptools import find_packages, setup 2 | 3 | setup( 4 | name="odoo-project", 5 | version='1.0.0', 6 | description="Odoo Project", 7 | license='GNU Affero General Public License v3 or later (AGPLv3+)', 8 | author="Camptocamp", 9 | author_email="info@camptocamp.com", 10 | url="www.camptocamp.com", 11 | packages=['songs'] + ['songs.%s' % p for p in find_packages('./songs')], 12 | include_package_data=True, 13 | odoo_addons=True, 14 | ) 15 | 16 | -------------------------------------------------------------------------------- /example/songs/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/camptocamp/docker-odoo-project/159992a9cc1ac4a1715ee4f7f8e9e714b7b78d98/example/songs/__init__.py -------------------------------------------------------------------------------- /example/songs/install/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/camptocamp/docker-odoo-project/159992a9cc1ac4a1715ee4f7f8e9e714b7b78d98/example/songs/install/__init__.py -------------------------------------------------------------------------------- /example/songs/install/base.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Copyright 2016 Camptocamp SA 3 | # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html) 4 | 5 | from base64 import b64encode 6 | from pkg_resources import Requirement, resource_string 7 | from anthem.lyrics.records import create_or_update 8 | 9 | 10 | def setup_company(ctx, req): 11 | """Setup company""" 12 | company = ctx.env.ref("base.main_company") 13 | company.name = "Rainbow Holding" 14 | 15 | # load logo on company 16 | logo_content = resource_string(req, "data/images/logo.png") 17 | logo = b64encode(logo_content) 18 | company.logo = logo 19 | 20 | values = { 21 | "name": "Rainbow company", 22 | "street": "Rainbow Street 1", 23 | "zip": "1000", 24 | "city": "There", 25 | "parent_id": company.id, 26 | "logo": logo, 27 | } 28 | create_or_update(ctx, "res.company", "__setup__.company_rainbow", values) 29 | 30 | 31 | def main(ctx): 32 | """Create demo data""" 33 | req = Requirement.parse("odoo-project") 34 | setup_company(ctx, req) 35 | -------------------------------------------------------------------------------- /example/songs/install/demo.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Copyright 2016 Camptocamp SA 3 | # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html) 4 | 5 | from anthem.lyrics.records import create_or_update 6 | 7 | 8 | def create_partners(ctx): 9 | names = [('Khiank Mountaingut', 'partner_1'), 10 | ('Kher Fernthorn', 'partner_2'), 11 | ('Sheing Coaldigger', 'partner_3'), 12 | ] 13 | for name, xmlid in names: 14 | create_or_update(ctx, 'res.partner', xmlid, {'name': name}) 15 | 16 | 17 | def main(ctx): 18 | create_partners(ctx) 19 | -------------------------------------------------------------------------------- /example/test-compose.yml: -------------------------------------------------------------------------------- 1 | # Composition used to run automated tests on the images 2 | # Used by the Makefile at the repository's root 3 | 4 | version: '3.8' 5 | 6 | services: 7 | odoo: 8 | build: . 9 | depends_on: 10 | - db 11 | - kwkhtmltopdf 12 | volumes: 13 | - "data-odoo:/data/odoo" 14 | - "./odoo/addons:/odoo/odoo/addons" 15 | environment: 16 | - DB_USER=odoo 17 | - DB_PASS=odoo 18 | - DB_NAME=odoodb 19 | - RUNNING_ENV=dev 20 | - LOG_HANDLER=:WARN 21 | - MARABUNTA_MODE=demo # could be 'full' for the db with all the data 22 | - KWKHTMLTOPDF_SERVER_URL=http://kwkhtmltopdf:8080 23 | - ODOO_REPORT_URL=http://odoo:8069 24 | - LOCAL_CODE_PATH=/odoo/odoo/addons 25 | - MIGRATION_CONFIG_FILE=/odoo/migration.yml 26 | # cached database dumps config for `runmigration` and `runtests` 27 | - CREATE_DB_CACHE=false # set it to 'true' to create dumps 28 | - LOAD_DB_CACHE=true # by default will always search for existing dumps 29 | # SUBS_MD5 is `runtests` only, you need to define it to identify dumps, 30 | # a good practice is to generate it based on the content you have in 31 | # your dependencies (`odoo/src`, `odoo/external-src`) 32 | # See README.md for more. 33 | - SUBS_MD5= 34 | # MIG_LOAD_VERSION is `runmigration` only, define it if you want to load 35 | # a prior release dump that doesn't match `odoo/VERSION` number. 36 | # See README.md for more. 37 | - MIG_LOAD_VERSION_CEIL= 38 | 39 | db: 40 | image: postgres:13.0 41 | ports: 42 | - 5432 43 | environment: 44 | - POSTGRES_USER=odoo 45 | - POSTGRES_PASSWORD=odoo 46 | volumes: 47 | - "data-db:/var/lib/postgresql/data" 48 | 49 | kwkhtmltopdf: 50 | image: acsone/kwkhtmltopdf 51 | ports: 52 | - 8080 53 | 54 | volumes: 55 | data-odoo: 56 | data-db: 57 | -------------------------------------------------------------------------------- /install/dev_package.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -eo pipefail 3 | 4 | apt-get update 5 | apt-get install -y --no-install-recommends $BUILD_PACKAGE 6 | -------------------------------------------------------------------------------- /install/disable_dst_root_cert-jessie.sh: -------------------------------------------------------------------------------- 1 | # Following the expiracy of DST Root X3 certificate 2 | # the chain of trust of openssl cannot use the valid ISRG Root X1 3 | # Thus we have to disable the expired certificate 4 | sed -i '/^mozilla\/DST_Root_CA_X3.crt$/ s/^/!/' /etc/ca-certificates.conf 5 | update-ca-certificates 6 | -------------------------------------------------------------------------------- /install/dockerize.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -eo pipefail 3 | 4 | curl -o dockerize-linux-amd64-v0.6.0.tar.gz https://github.com/jwilder/dockerize/releases/download/v0.6.0/dockerize-linux-amd64-v0.6.0.tar.gz -SL 5 | echo 'a13ff2aa6937f45ccde1f29b1574744930f5c9a5 dockerize-linux-amd64-v0.6.0.tar.gz' | sha1sum -c - 6 | tar xvfz dockerize-linux-amd64-v0.6.0.tar.gz -C /usr/local/bin && rm dockerize-linux-amd64-v0.6.0.tar.gz 7 | -------------------------------------------------------------------------------- /install/kwkhtml_client.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -eo pipefail 3 | 4 | curl -o kwkhtmltopdf_client -SL https://raw.githubusercontent.com/camptocamp/kwkhtmltopdf/master/client/python/kwkhtmltopdf_client.py 5 | echo '8676b798f57c67e3a801caad4c91368929c427ce kwkhtmltopdf_client' | sha1sum -c - 6 | mv kwkhtmltopdf_client /usr/local/bin/wkhtmltopdf 7 | chmod a+x /usr/local/bin/wkhtmltopdf -------------------------------------------------------------------------------- /install/kwkhtml_client_force_python3.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -eo pipefail 3 | 4 | sed -i "1 s/python/python3/g" /usr/local/bin/wkhtmltopdf -------------------------------------------------------------------------------- /install/package_odoo.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -eo pipefail 3 | 4 | apt-get update -o Acquire::AllowInsecureRepositories=true 5 | apt-get install -y --no-install-recommends \ 6 | antiword \ 7 | ca-certificates \ 8 | curl \ 9 | dirmngr \ 10 | ghostscript \ 11 | graphviz \ 12 | gnupg2 \ 13 | less \ 14 | nano \ 15 | node-clean-css \ 16 | node-less \ 17 | poppler-utils \ 18 | adduser \ 19 | fonts-dejavu-core \ 20 | fonts-freefont-ttf \ 21 | fonts-freefont-otf \ 22 | fonts-noto-core \ 23 | fonts-inconsolata \ 24 | fonts-font-awesome \ 25 | fonts-roboto-unhinted \ 26 | gsfonts \ 27 | libjs-underscore \ 28 | lsb-base \ 29 | postgresql-client \ 30 | python3 \ 31 | python3-pip \ 32 | python3-setuptools \ 33 | python3-renderpm \ 34 | python3-wheel \ 35 | libxslt1.1 \ 36 | xfonts-75dpi \ 37 | xfonts-base \ 38 | xz-utils \ 39 | tcl\ 40 | git \ 41 | gnupg2 \ 42 | expect \ 43 | patch \ 44 | vim-tiny \ 45 | procps 46 | -------------------------------------------------------------------------------- /install/package_odoo_11.0_12.0.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -eo pipefail 3 | 4 | apt-get update 5 | apt-get purge python2.7 python2.7-minimal 6 | apt-get install -y --no-install-recommends \ 7 | antiword \ 8 | ca-certificates \ 9 | curl \ 10 | dirmngr \ 11 | ghostscript \ 12 | graphviz \ 13 | gnupg2 \ 14 | less \ 15 | nano \ 16 | node-clean-css \ 17 | node-less \ 18 | poppler-utils \ 19 | python \ 20 | python-libxslt1 \ 21 | python-pip \ 22 | python3-pip \ 23 | python3-setuptools \ 24 | python3-renderpm \ 25 | python3-wheel \ 26 | libxslt1.1 \ 27 | xfonts-75dpi \ 28 | xfonts-base \ 29 | xz-utils \ 30 | tcl expect 31 | -------------------------------------------------------------------------------- /install/postgres.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -eo pipefail 3 | 4 | OS_CODENAME=$(awk -F= '$1=="VERSION_CODENAME" { print $2 ;}' /etc/os-release) 5 | 6 | if [ -z "$OS_CODENAME" ] 7 | then 8 | # VERSION_CODENAME doesn't exist in jessie 9 | # To remove on drop of support of jessie 10 | OS_CODENAME="jessie" 11 | fi 12 | 13 | 14 | APT_REPO="apt.postgresql.org" 15 | if [ $OS_CODENAME = "jessie" ] || [ $OS_CODENAME = "stretch" ] 16 | then 17 | APT_REPO="apt-archive.postgresql.org" 18 | fi 19 | 20 | echo "deb http://${APT_REPO}/pub/repos/apt/ ${OS_CODENAME}-pgdg main" > /etc/apt/sources.list.d/pgdg.list 21 | curl https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - 22 | 23 | apt-get update 24 | apt-get install -y --no-install-recommends postgresql-client libpq-dev 25 | apt-get -y install -f --no-install-recommends 26 | -------------------------------------------------------------------------------- /install/purge_dev_package_and_cache.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -eo pipefail 3 | 4 | apt-get remove -y $BUILD_PACKAGE 5 | apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false -o APT::AutoRemove::SuggestsImportant=false $PURGE_PACKAGE 6 | rm -rf /var/lib/apt/lists/* /root/.cache/pip/* 7 | -------------------------------------------------------------------------------- /install/reportlab_init.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -xe 3 | python3 -c "import urllib.request 4 | url = 'http://www.reportlab.com/ftp/pfbfer.zip' 5 | urllib.request.urlretrieve(url, '/tmp/pfbfer.zip')" 6 | apt update 7 | apt install unzip -y 8 | mkdir /usr/lib/python3/dist-packages/reportlab/fonts 9 | cd /usr/lib/python3/dist-packages/reportlab/fonts 10 | unzip /tmp/pfbfer.zip 11 | rm -rf /tmp/pfbfer.zip 12 | 13 | 14 | -------------------------------------------------------------------------------- /install/setup-pip.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -eo pipefail 3 | # Install pip with ensuire pip 4 | python -m ensurepip 5 | cat << EOF > /etc/pip.conf 6 | [global] 7 | # counter-intuitively, false means that we enable 'no-cache-dir' 8 | # "To enable the boolean options --no-compile and --no-cache-dir, falsy values have to be used" 9 | # https://pip.pypa.io/en/stable/user_guide/#configuration 10 | no-cache-dir = false 11 | disable-pip-version-check = True 12 | EOF 13 | -------------------------------------------------------------------------------- /setup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -euxo pipefail 3 | 4 | # 5 | # Build the image 6 | # 7 | # Normally run by the Makefile: 8 | # 9 | # $ make VERSION=$VERSION build 10 | # 11 | # It expects the following variables to be set: 12 | # 13 | # * VERSION (9.0, 10.0, 11.0, ...) 14 | # * BUILD_TAG (tag of the 'latest' image built) 15 | # 16 | if [ -z "$VERSION" ]; then 17 | echo "VERSION environment variable is missing" 18 | exit 1 19 | fi 20 | 21 | SRC=${SRC:=(mktemp -d)} 22 | echo "Creating $SRC" 23 | 24 | cp -r ${VERSION}/. $SRC/ 25 | cp -r bin/ $SRC 26 | cp -r install/ $SRC 27 | cp -r start-entrypoint.d/ $SRC 28 | cp -r before-migrate-entrypoint.d/ $SRC 29 | -------------------------------------------------------------------------------- /start-entrypoint.d/000_set_base_url: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | DOMAIN="${ODOO_BASE_URL}" 4 | 5 | if [ -n "$DOMAIN" ]; then 6 | 7 | if [ "$( psql -tAc "SELECT 1 FROM pg_database WHERE datname='$DB_NAME'" )" != '1' ] 8 | then 9 | echo "Database does not exist, ignoring script" 10 | exit 0 11 | fi 12 | 13 | echo "Setting Base URL to domain ${DOMAIN}" 14 | psql --quiet << EOF 15 | 16 | WITH update_param AS ( 17 | UPDATE ir_config_parameter 18 | SET value = '${DOMAIN}' 19 | WHERE key = 'web.base.url' 20 | RETURNING * 21 | ) 22 | INSERT INTO ir_config_parameter 23 | (value, key, create_uid, write_uid, create_date, write_date) 24 | SELECT '${DOMAIN}', 'web.base.url', 1, 1, now(), now() 25 | WHERE NOT EXISTS (SELECT * FROM update_param); 26 | 27 | WITH update_param AS ( 28 | UPDATE ir_config_parameter 29 | SET value = 'True' 30 | WHERE key = 'web.base.url.freeze' 31 | RETURNING * 32 | ) 33 | INSERT INTO ir_config_parameter 34 | (value, key, create_uid, write_uid, create_date, write_date) 35 | SELECT 'True', 'web.base.url.freeze', 1, 1, now(), now() 36 | WHERE NOT EXISTS (SELECT * FROM update_param); 37 | 38 | EOF 39 | fi 40 | -------------------------------------------------------------------------------- /start-entrypoint.d/001_set_report_url: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | DOMAIN="${ODOO_REPORT_URL}" 4 | 5 | if [ -n "$DOMAIN" ]; then 6 | 7 | if [ "$( psql -tAc "SELECT 1 FROM pg_database WHERE datname='$DB_NAME'" )" != '1' ] 8 | then 9 | echo "Database does not exist, ignoring script" 10 | exit 0 11 | fi 12 | 13 | echo "Setting Report URL to domain ${DOMAIN}" 14 | psql --quiet << EOF 15 | 16 | WITH update_param AS ( 17 | UPDATE ir_config_parameter 18 | SET value = '${DOMAIN}' 19 | WHERE key = 'report.url' 20 | RETURNING * 21 | ) 22 | INSERT INTO ir_config_parameter 23 | (value, key, create_uid, write_uid, create_date, write_date) 24 | SELECT '${DOMAIN}', 'report.url', 1, 1, now(), now() 25 | WHERE NOT EXISTS (SELECT * FROM update_param); 26 | 27 | EOF 28 | fi 29 | -------------------------------------------------------------------------------- /test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -Exeo pipefail 3 | 4 | # 5 | # Run tests on the image 6 | # 7 | # It assumes the image already exists. 8 | # Normally run by the Makefile: 9 | # 10 | # $ make VERSION=$VERSION build 11 | # $ make VERSION=$VERSION test 12 | # 13 | # It expects the following variables to be set: 14 | # 15 | # * VERSION (9.0, 10.0, 11.0, ...) 16 | # * IMAGE_LATEST (tag of the 'latest' image built) 17 | # 18 | # if VERSION is not set, we will use the default 15.0 19 | if [ -z "$VERSION" ]; then 20 | export VERSION=15.0 21 | fi 22 | if [ -z "$IMAGE_LATEST" ]; then 23 | export IMAGE_LATEST=odoo:15.0 24 | fi 25 | if [ -z "$VERSION" ]; then 26 | echo "VERSION environment variable is missing" 27 | exit 1 28 | fi 29 | 30 | 31 | ODOO_URL="https://github.com/odoo/odoo/archive/${VERSION}.tar.gz" 32 | 33 | TMP=$(mktemp -d) 34 | echo "Working in $TMP" 35 | 36 | on_exit() { 37 | echo "Cleaning up temporary directory..." 38 | cd $TMP 39 | docker compose -f test-compose.yml down 40 | rm -rf $TMP 41 | rm -f /tmp/odoo.tar.gz 42 | } 43 | 44 | trap on_exit EXIT 45 | 46 | # run 'runtests' in the container 47 | # extra arguments are passed to the 'run' command (example: -e FOO=bar is added to the list of args) 48 | docoruntests() { 49 | docker compose -f test-compose.yml run --rm -e LOCAL_USER_ID=999 $@ odoo runtests 50 | } 51 | # run 'runmigration' in the container 52 | # extra arguments are passed to the 'run' command (example: -e FOO=bar is added to the list of args) 53 | docorunmigration() { 54 | docker compose -f test-compose.yml run --rm -e LOCAL_USER_ID=999 $@ odoo runmigration 55 | } 56 | docodown() { 57 | docker compose -f test-compose.yml down 58 | } 59 | docoruncmd() { 60 | docker compose -f test-compose.yml run --rm -e LOCAL_USER_ID=999 $@ 61 | } 62 | 63 | cp -ra ./example/. "$TMP/" 64 | cd "$TMP" 65 | 66 | echo '>>> Downloading Odoo src' 67 | rm -rf "$TMP/odoo/src" 68 | wget -nv -O /tmp/odoo.tar.gz "$ODOO_URL" 69 | mkdir -p odoo/src 70 | tar xfz /tmp/odoo.tar.gz -C odoo/src 71 | mv "odoo/src/odoo-$VERSION" odoo/src/odoo 72 | ls odoo/src/odoo 73 | echo '>>> Run test for base image' 74 | sed "s|FROM .*|FROM ${IMAGE_LATEST}|" -i Dockerfile 75 | sed "s|version=.*|version=""'""${VERSION}"".1.0.0""'"",|" -i setup.py 76 | sed "s|\(.version.: .\)[0-9.]*\(.*\)|\\1$VERSION.0.0.0\\2|" -i odoo/addons/dummy_test/__manifest__.py 77 | echo $VERSION.0.0.0 > VERSION 78 | 79 | cat setup.py 80 | cat odoo/addons/dummy_test/__manifest__.py 81 | mkdir .cachedb 82 | 83 | echo '>>> * migration: standard' 84 | docoruncmd -e LOAD_DB_CACHE="false" odoo odoo --stop-after-init 85 | 86 | echo '>>> * migration: create the dump for a base version' 87 | docorunmigration -e CREATE_DB_CACHE="true" 88 | docoruncmd odoo dropdb odoodb 89 | 90 | echo '>>> * migration: use the dump and migrate to new version' 91 | docorunmigration -e LOAD_DB_CACHE="true" 92 | docodown 93 | echo " - version: 15.0.1" >>migration.yml 94 | echo " operations:" >>migration.yml 95 | echo " post:" >>migration.yml 96 | echo " - anthem songs.install.demo::create_partners" >>migration.yml 97 | docoruncmd odoo dropdb odoodb 98 | 99 | echo '>>> * migration: use a ceil version' 100 | docoruntests -e LOAD_DB_CACHE="true" -e MIG_LOAD_VERSION_CEIL="15.0.1" 101 | 102 | echo '>>> * run unit tests with runtests' 103 | docoruntests -e LOAD_DB_CACHE="false" -e CREATE_DB_CACHE="false" 104 | 105 | echo '>>> * run unit tests with runtests and create a dump' 106 | docoruntests -e CREATE_DB_CACHE="true" -e SUBS_MD5=testcache 107 | 108 | echo '>>> * run unit tests with runtests and re-use a dump' 109 | docoruntests -e LOAD_DB_CACHE="true" -e SUBS_MD5=testcache 110 | docodown 111 | 112 | docoruncmd odoo odoo --stop-after-init 113 | docoruntests 114 | 115 | docodown 116 | --------------------------------------------------------------------------------