diff --git a/newsfragments/add-17.0 b/newsfragments/add-17.0 new file mode 100644 index 0000000..f222b5a --- /dev/null +++ b/newsfragments/add-17.0 @@ -0,0 +1 @@ +Support 17.0 serie. diff --git a/newsfragments/add-18.0 b/newsfragments/add-18.0 new file mode 100644 index 0000000..cbec939 --- /dev/null +++ b/newsfragments/add-18.0 @@ -0,0 +1 @@ +Support 18.0 serie. diff --git a/odoo_openupgrade_wizard/configuration_version_dependant.py b/odoo_openupgrade_wizard/configuration_version_dependant.py index e3e6f47..fc3f90b 100644 --- a/odoo_openupgrade_wizard/configuration_version_dependant.py +++ b/odoo_openupgrade_wizard/configuration_version_dependant.py @@ -2,7 +2,15 @@ from pathlib import Path from loguru import logger -_ALL_ODOO_VERSIONS = [8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0] +FIRST_ODOO_VERSION_SUPPORTED = 8 +LAST_ODOO_VERSION_SUPPORTED = 18 + +_ALL_ODOO_VERSIONS = [ + float(x) + for x in range( + FIRST_ODOO_VERSION_SUPPORTED, LAST_ODOO_VERSION_SUPPORTED + 1 + ) +] def get_version_options(mode: str) -> list: diff --git a/odoo_openupgrade_wizard/templates/odoo/11.0/Dockerfile b/odoo_openupgrade_wizard/templates/odoo/11.0/Dockerfile index 73c8130..c4404a2 100644 --- a/odoo_openupgrade_wizard/templates/odoo/11.0/Dockerfile +++ b/odoo_openupgrade_wizard/templates/odoo/11.0/Dockerfile @@ -13,7 +13,7 @@ RUN apt-get update && \ RUN dpkg-reconfigure locales && \ locale-gen C.UTF-8 && \ /usr/sbin/update-locale LANG=C.UTF-8 -ENV LC_ALL C.UTF-8 +ENV LC_ALL=C.UTF-8 RUN apt-get update -qq && \ apt-get upgrade -qq -y && \ diff --git a/odoo_openupgrade_wizard/templates/odoo/12.0/Dockerfile b/odoo_openupgrade_wizard/templates/odoo/12.0/Dockerfile index f9e2c80..8d92257 100644 --- a/odoo_openupgrade_wizard/templates/odoo/12.0/Dockerfile +++ b/odoo_openupgrade_wizard/templates/odoo/12.0/Dockerfile @@ -13,7 +13,7 @@ RUN apt-get update && \ RUN dpkg-reconfigure locales && \ locale-gen C.UTF-8 && \ /usr/sbin/update-locale LANG=C.UTF-8 -ENV LC_ALL C.UTF-8 +ENV LC_ALL=C.UTF-8 RUN apt-get update -qq && \ apt-get upgrade -qq -y && \ diff --git a/odoo_openupgrade_wizard/templates/odoo/13.0/Dockerfile b/odoo_openupgrade_wizard/templates/odoo/13.0/Dockerfile index d2935c3..b98352a 100644 --- a/odoo_openupgrade_wizard/templates/odoo/13.0/Dockerfile +++ b/odoo_openupgrade_wizard/templates/odoo/13.0/Dockerfile @@ -9,7 +9,7 @@ RUN apt-get update && \ RUN dpkg-reconfigure locales && \ locale-gen C.UTF-8 && \ /usr/sbin/update-locale LANG=C.UTF-8 -ENV LC_ALL C.UTF-8 +ENV LC_ALL=C.UTF-8 RUN apt-get update -qq && \ apt-get upgrade -qq -y && \ diff --git a/odoo_openupgrade_wizard/templates/odoo/14.0/Dockerfile b/odoo_openupgrade_wizard/templates/odoo/14.0/Dockerfile index 59751ee..f3a2ac0 100644 --- a/odoo_openupgrade_wizard/templates/odoo/14.0/Dockerfile +++ b/odoo_openupgrade_wizard/templates/odoo/14.0/Dockerfile @@ -9,7 +9,7 @@ RUN apt-get update && \ RUN dpkg-reconfigure locales && \ locale-gen C.UTF-8 && \ /usr/sbin/update-locale LANG=C.UTF-8 -ENV LC_ALL C.UTF-8 +ENV LC_ALL=C.UTF-8 RUN apt-get update -qq && \ apt-get upgrade -qq -y && \ diff --git a/odoo_openupgrade_wizard/templates/odoo/15.0/Dockerfile b/odoo_openupgrade_wizard/templates/odoo/15.0/Dockerfile index f5d3860..546f052 100644 --- a/odoo_openupgrade_wizard/templates/odoo/15.0/Dockerfile +++ b/odoo_openupgrade_wizard/templates/odoo/15.0/Dockerfile @@ -9,7 +9,7 @@ RUN apt-get update && \ RUN dpkg-reconfigure locales && \ locale-gen C.UTF-8 && \ /usr/sbin/update-locale LANG=C.UTF-8 -ENV LC_ALL C.UTF-8 +ENV LC_ALL=C.UTF-8 RUN apt-get update -qq && \ apt-get upgrade -qq -y && \ diff --git a/odoo_openupgrade_wizard/templates/odoo/16.0/Dockerfile b/odoo_openupgrade_wizard/templates/odoo/16.0/Dockerfile index 6779c90..6d1ce7d 100644 --- a/odoo_openupgrade_wizard/templates/odoo/16.0/Dockerfile +++ b/odoo_openupgrade_wizard/templates/odoo/16.0/Dockerfile @@ -9,7 +9,7 @@ RUN apt-get update && \ RUN dpkg-reconfigure locales && \ locale-gen C.UTF-8 && \ /usr/sbin/update-locale LANG=C.UTF-8 -ENV LC_ALL C.UTF-8 +ENV LC_ALL=C.UTF-8 RUN apt-get update -qq && \ apt-get upgrade -qq -y && \ diff --git a/odoo_openupgrade_wizard/templates/odoo/17.0/Dockerfile b/odoo_openupgrade_wizard/templates/odoo/17.0/Dockerfile new file mode 100644 index 0000000..db0fe1b --- /dev/null +++ b/odoo_openupgrade_wizard/templates/odoo/17.0/Dockerfile @@ -0,0 +1,50 @@ +# : Copy of https://github.com/odoo/odoo/blob/17.0/setup/package.dfsrc +FROM debian:bookworm + +RUN apt-get update && \ + apt-get install -y locales && \ + rm -rf /var/lib/apt/lists/* + +# Reconfigure locales such that postgresql uses UTF-8 encoding +RUN dpkg-reconfigure locales && \ + locale-gen C.UTF-8 && \ + /usr/sbin/update-locale LANG=C.UTF-8 +ENV LC_ALL=C.UTF-8 + +RUN apt-get update -qq && \ + apt-get upgrade -qq -y && \ + apt-get install \ + postgresql \ + postgresql-server-dev-all \ + postgresql-client \ + adduser \ + libldap2-dev \ + libsasl2-dev \ + python3-pip \ + python3-venv \ + python3-wheel \ + build-essential \ + python3 -y && \ + rm -rf /var/lib/apt/lists/* + +# Install Debian packages +COPY extra_debian_requirements.txt /extra_debian_requirements.txt +RUN apt-get update -qq \ + && apt-get install -y git \ + && xargs apt-get install -y --no-install-recommends Install Python librairies +COPY ./src/odoo/requirements.txt /odoo_python_requirements.txt +COPY extra_python_requirements.txt /extra_python_requirements.txt +RUN pip3 install --upgrade pip --break-system-packages \ + && python3 -m pip install --no-cache-dir setuptools-scm --break-system-packages \ + && python3 -m pip install --no-cache-dir -r /odoo_python_requirements.txt --break-system-packages \ + && python3 -m pip install --no-cache-dir -r /extra_python_requirements.txt --break-system-packages + +# Get local user id and set it to the odoo user +ARG LOCAL_USER_ID + +RUN useradd --uid $LOCAL_USER_ID --non-unique odoo + +USER odoo diff --git a/odoo_openupgrade_wizard/templates/odoo/18.0/Dockerfile b/odoo_openupgrade_wizard/templates/odoo/18.0/Dockerfile new file mode 100644 index 0000000..7f0db7a --- /dev/null +++ b/odoo_openupgrade_wizard/templates/odoo/18.0/Dockerfile @@ -0,0 +1,50 @@ +# : Copy of https://github.com/odoo/odoo/blob/18.0/setup/package.dfsrc +FROM debian:bookworm + +RUN apt-get update && \ + apt-get install -y locales && \ + rm -rf /var/lib/apt/lists/* + +# Reconfigure locales such that postgresql uses UTF-8 encoding +RUN dpkg-reconfigure locales && \ + locale-gen C.UTF-8 && \ + /usr/sbin/update-locale LANG=C.UTF-8 +ENV LC_ALL=C.UTF-8 + +RUN apt-get update -qq && \ + apt-get upgrade -qq -y && \ + apt-get install \ + postgresql \ + postgresql-server-dev-all \ + postgresql-client \ + adduser \ + libldap2-dev \ + libsasl2-dev \ + python3-pip \ + python3-venv \ + python3-wheel \ + build-essential \ + python3 -y && \ + rm -rf /var/lib/apt/lists/* + +# Install Debian packages +COPY extra_debian_requirements.txt /extra_debian_requirements.txt +RUN apt-get update -qq \ + && apt-get install -y git \ + && xargs apt-get install -y --no-install-recommends Install Python librairies +COPY ./src/odoo/requirements.txt /odoo_python_requirements.txt +COPY extra_python_requirements.txt /extra_python_requirements.txt +RUN pip3 install --upgrade pip --break-system-packages \ + && python3 -m pip install --no-cache-dir setuptools-scm --break-system-packages \ + && python3 -m pip install --no-cache-dir -r /odoo_python_requirements.txt --break-system-packages \ + && python3 -m pip install --no-cache-dir -r /extra_python_requirements.txt --break-system-packages + +# Get local user id and set it to the odoo user +ARG LOCAL_USER_ID + +RUN useradd --uid $LOCAL_USER_ID --non-unique odoo + +USER odoo