From 9f0b1ac33b5f5b5f496e164fda6cb7632cd0a89e Mon Sep 17 00:00:00 2001 From: Dmytro Katyukha Date: Wed, 15 Nov 2023 13:46:21 +0200 Subject: [PATCH 1/3] [FIX] Add error handling on failure on download of deb control file for odoo --- lib/install.bash | 7 ++++++- lib/version.bash | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/install.bash b/lib/install.bash index af22e0e..ec5ae4a 100644 --- a/lib/install.bash +++ b/lib/install.bash @@ -438,7 +438,12 @@ function install_sys_deps_for_odoo_version { local control_url="https://raw.githubusercontent.com/odoo/odoo/$odoo_branch/debian/control"; local tmp_control; tmp_control=$(mktemp); - wget -q -T 15 "$control_url" -O "$tmp_control"; + + if ! wget -q -T 15 "$control_url" -O "$tmp_control"; then + echoe -e "${REDC}ERROR${NC}: Cannot download debian control file from '$control_url'!"; + return 2; + fi + local sys_deps; mapfile -t sys_deps < <(ODOO_VERSION="$odoo_version" install_parse_debian_control_file "$tmp_control"); install_sys_deps_internal "${sys_deps[@]}"; diff --git a/lib/version.bash b/lib/version.bash index 86fc9a9..1ed6eb0 100644 --- a/lib/version.bash +++ b/lib/version.bash @@ -9,5 +9,5 @@ # Odoo Helper Scripts: Version # Define version number -ODOO_HELPER_VERSION="1.4.0"; +ODOO_HELPER_VERSION="1.5.0-dev"; ODOO_HELPER_CONFIG_VERSION="1"; From 4504044e464e6beb9ba82cb17ab429a707fb5498 Mon Sep 17 00:00:00 2001 From: Dmytro Katyukha Date: Wed, 15 Nov 2023 13:47:53 +0200 Subject: [PATCH 2/3] Add tests for Odoo 17 --- tests/test.bash | 70 ++++++++++++++++++++++++------------------------- 1 file changed, 35 insertions(+), 35 deletions(-) diff --git a/tests/test.bash b/tests/test.bash index 6614e89..474deef 100755 --- a/tests/test.bash +++ b/tests/test.bash @@ -983,54 +983,54 @@ odoo-helper db drop odoo16-odoo-test; #================================= #${NC}" -#cd ../; +cd ../; -## Remove odoo 17 -## this is needed to bypass gitlab.com limitation of disk space for CI jobs -#rm -rf ./odoo-16.0 +# Remove odoo 17 +# this is needed to bypass gitlab.com limitation of disk space for CI jobs +rm -rf ./odoo-16.0 -## Install odoo 17 -#odoo-helper install sys-deps -y 17.0; +# Install odoo 17 +odoo-helper install sys-deps -y 17.0; -#odoo-install --install-dir odoo-17.0 --odoo-version 17.0 \ - #--http-port 8569 --http-host local-odoo-16 \ - #--db-user odoo16 --db-pass odoo --create-db-user \ - #--build-python-if-needed +odoo-install --install-dir odoo-17.0 --odoo-version 17.0 \ + --http-port 8569 --http-host local-odoo-17 \ + --db-user odoo17 --db-pass odoo --create-db-user \ + --build-python-if-needed -#cd odoo-17.0; +cd odoo-17.0; -## Install py-tools and js-tools -#odoo-helper install py-tools; -#odoo-helper install js-tools; +# Install py-tools and js-tools +odoo-helper install py-tools; +odoo-helper install js-tools; -#odoo-helper server run --stop-after-init; # test that it runs +odoo-helper server run --stop-after-init; # test that it runs -## Show project status -#odoo-helper status; -#odoo-helper server status; -#odoo-helper start; -#odoo-helper ps; -#odoo-helper status; -#odoo-helper server status; -#odoo-helper stop; +# Show project status +odoo-helper status; +odoo-helper server status; +odoo-helper start; +odoo-helper ps; +odoo-helper status; +odoo-helper server status; +odoo-helper stop; -## Show complete odoo-helper status -#odoo-helper status --tools-versions --ci-tools-versions; +# Show complete odoo-helper status +odoo-helper status --tools-versions --ci-tools-versions; -## Database management -#odoo-helper db create --tdb --lang en_US; +# Database management +odoo-helper db create --tdb --lang en_US; -#odoo-helper addons update-list --tdb; -#odoo-helper addons install --tdb --module crm; -#odoo-helper addons test-installed crm; +odoo-helper addons update-list --tdb; +odoo-helper addons install --tdb --module crm; +odoo-helper addons test-installed crm; -#odoo-helper lsd; # List databases +odoo-helper lsd; # List databases -### Install addon website via 'odoo-helper install' -#odoo-helper install website; +## Install addon website via 'odoo-helper install' +odoo-helper install website; -## Drop created databases -#odoo-helper db drop odoo17-odoo-test; +# Drop created databases +odoo-helper db drop odoo17-odoo-test; echo -e "${YELLOWC} From c507ece8024940992b628a88da82cfc0daf8cf03 Mon Sep 17 00:00:00 2001 From: Dmytro Katyukha Date: Thu, 16 Nov 2023 10:50:02 +0200 Subject: [PATCH 3/3] Configured python versions suitable for Odoo version 17 --- lib/install.bash | 2 ++ lib/odoo.bash | 2 ++ 2 files changed, 4 insertions(+) diff --git a/lib/install.bash b/lib/install.bash index ec5ae4a..4e060b6 100644 --- a/lib/install.bash +++ b/lib/install.bash @@ -703,6 +703,8 @@ function install_build_python_guess_version { echo "3.8.13"; elif [ -n "$ODOO_VERSION" ] && [ "$(odoo_get_major_version)" -eq 16 ]; then echo "3.8.13"; + elif [ -n "$ODOO_VERSION" ] && [ "$(odoo_get_major_version)" -eq 17 ]; then + echo "3.10.13"; else echoe -e "${REDC}ERROR${NC}: Automatic detection of python version for odoo ${ODOO_VERSION} is not supported!"; return 1; diff --git a/lib/odoo.bash b/lib/odoo.bash index d90857a..b877ecb 100644 --- a/lib/odoo.bash +++ b/lib/odoo.bash @@ -289,6 +289,8 @@ function odoo_ensure_python_version { ${python_interpreter} -c "import sys; assert (3, 7) <= sys.version_info < (3, 11);"; elif [ -n "$ODOO_VERSION" ] && [ "$(odoo_get_major_version)" -eq 16 ]; then ${python_interpreter} -c "import sys; assert (3, 7) <= sys.version_info < (3, 11);"; + elif [ -n "$ODOO_VERSION" ] && [ "$(odoo_get_major_version)" -eq 17 ]; then + ${python_interpreter} -c "import sys; assert sys.version_info > (3, 10);"; else echoe -e "${REDC}ERROR${NC}: Automatic detection of python version for odoo ${ODOO_VERSION} is not supported!"; return 1;