Browse Source

popo

odoo_fix_webhook_url
default 1 year ago
parent
commit
f8792a8d6e
  1. 1
      odoo-tecnativa/hooks/init
  2. 15
      odoo-tecnativa/lib/common
  3. 18
      odoo-tecnativa/metadata.yml

1
odoo-tecnativa/hooks/init

@ -28,7 +28,6 @@ done
## workers management
workers=$(options-get workers 2>/dev/null) || true
workers=${workers:-1}
version=$(options-get version 2>/dev/null) || true
modules=$(options-get modules 2>/dev/null | yaml_get_values ,) || true
if [ -z "$modules" ]; then

15
odoo-tecnativa/lib/common

@ -9,3 +9,18 @@ get_odoo_uid() {
info "openerp uid from ${DARKYELLOW}$SERVICE_NAME${NORMAL} is '$odoo_uid'"
echo "$odoo_uid"
}
get_odoo_version() {
local odoo_version
odoo_version=$(cached_cmd_on_base_image "$SERVICE_NAME" \
"python -c 'import odoo; print(odoo.cli.server.__version__)'"
) || {
debug "Failed to query for odoo version in ${DARKYELLOW}$SERVICE_NAME${NORMAL} base image."
return 1
}
info "odoo version from ${DARKYELLOW}$SERVICE_NAME${NORMAL} is '$odoo_version'"
echo "${odoo_version%%.*}"
}
export -f get_odoo_version

18
odoo-tecnativa/metadata.yml

@ -63,14 +63,16 @@ uses:
- !bash-stdout |
workers=$(relation-base-compose-get workers 2>/dev/null)
workers=${workers:-1}
version=$(relation-base-compose-get version 2>/dev/null)
if [ "$workers" -gt 1 ] && [ $version -lt 16]; then
echo "ProxyPass /longpolling/ http://${MASTER_BASE_SERVICE_NAME}:8072/longpolling/"
echo "ProxyPassReverse /longpolling/ http://${MASTER_BASE_SERVICE_NAME}:8072/longpolling/"
fi
if [ "$workers" -gt 1 ] && [ $version -ge 16]; then
echo "ProxyPass /websocket/ http://${MASTER_BASE_SERVICE_NAME}:8072/websocket/"
echo "ProxyPassReverse /websocket/ http://${MASTER_BASE_SERVICE_NAME}:8072/websocket/"
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
if [ "${version%.*}" -lt 15 ]; 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

Loading…
Cancel
Save