From f082357657e10963087f40076b67b25bc46bc619 Mon Sep 17 00:00:00 2001 From: Valentin Lab Date: Mon, 7 Aug 2023 20:41:40 +0200 Subject: [PATCH] fix: [odoo-tecnativa] support websocket in version ``16.0`` --- odoo-tecnativa/metadata.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/odoo-tecnativa/metadata.yml b/odoo-tecnativa/metadata.yml index ee13bf5..f40af39 100644 --- a/odoo-tecnativa/metadata.yml +++ b/odoo-tecnativa/metadata.yml @@ -63,9 +63,16 @@ uses: - !bash-stdout | workers=$(relation-base-compose-get workers 2>/dev/null) workers=${workers:-1} + version=$(cached_cmd_on_base_image "$MASTER_BASE_SERVICE_NAME" \ + "python -c 'import odoo; print(odoo.cli.server.__version__)'") || exit 1 if [ "$workers" -gt 1 ]; then - echo "ProxyPass /longpolling/ http://${MASTER_BASE_SERVICE_NAME}:8072/longpolling/" - echo "ProxyPassReverse /longpolling/ http://${MASTER_BASE_SERVICE_NAME}:8072/longpolling/" + if [ "${version%.*}" -lt 16 ]; then + echo "ProxyPass /longpolling/ http://${MASTER_BASE_SERVICE_NAME}:8072/longpolling/" + echo "ProxyPassReverse /longpolling/ http://${MASTER_BASE_SERVICE_NAME}:8072/longpolling/" + else + echo "ProxyPass /websocket ws://${MASTER_BASE_SERVICE_NAME}:8072/websocket" + echo "ProxyPassReverse /websocket ws://${MASTER_BASE_SERVICE_NAME}:8072/websocket" + fi fi backup: constraint: recommended