diff --git a/Chart.yaml b/Chart.yaml index 38cd350..b4789e3 100644 --- a/Chart.yaml +++ b/Chart.yaml @@ -5,7 +5,7 @@ description: | Variation between instances is expressed via values.yaml only. No chart variants. No string-templating in Tower. type: application -version: 0.1.2 +version: 0.1.3 appVersion: "1.0" keywords: - odoo diff --git a/templates/odoo-deployment.yaml b/templates/odoo-deployment.yaml index 07147e4..e9f953a 100644 --- a/templates/odoo-deployment.yaml +++ b/templates/odoo-deployment.yaml @@ -123,13 +123,25 @@ spec: cat > /target/odoosky_hoot_dom_shim/__manifest__.py <<'PYEOF' { 'name': 'OdooSky hoot-dom backend shim', - 'version': '18.0.1.0.0', + 'version': '18.0.1.0.1', 'category': 'Hidden', - 'summary': 'Inject web/static/lib/hoot-dom/**/* into web.assets_backend (workaround for upstream manifest bug)', + 'summary': 'Inject hoot/hoot-dom + module loader into web.assets_backend (workaround for upstream manifest bug)', 'depends': ['web'], + # Mirror the asset list from web.__manifest__.py's + # assets_unit_tests_setup bundle. The loader at the + # end registers each lib file as an `@odoo/hoot-dom` + # module — without it, the bare lib files don't + # define themselves as the dependency name production + # code references. We exclude the same test artifacts + # the upstream bundle excludes (hoot_style.css + + # hoot/tests). 'assets': { 'web.assets_backend': [ + 'web/static/lib/hoot/**/*', 'web/static/lib/hoot-dom/**/*', + ('remove', 'web/static/lib/hoot/ui/hoot_style.css'), + ('remove', 'web/static/lib/hoot/tests/**/*'), + 'web/static/tests/_framework/hoot_module_loader.js', ], }, 'installable': True, @@ -240,21 +252,30 @@ spec: # row that adds web/static/lib/hoot-dom/**/* to the # web.assets_backend bundle on next regeneration. See # platform-shim initContainer for the why. - SHIM_INSTALLED="" + SHIM_INSTALLED_VER="" IS_INIT_AFTER=$(PGPASSWORD="$PASSWORD" psql -h "$HOST" -p "$PORT" -U "$USER" -d "$DBNAME" -tAc \ "SELECT 1 FROM information_schema.tables WHERE table_schema='public' AND table_name='ir_module_module'" 2>/dev/null || true) if [ "$IS_INIT_AFTER" = "1" ]; then - SHIM_INSTALLED=$(PGPASSWORD="$PASSWORD" psql -h "$HOST" -p "$PORT" -U "$USER" -d "$DBNAME" -tAc \ - "SELECT 1 FROM ir_module_module WHERE name='odoosky_hoot_dom_shim' AND state='installed'" 2>/dev/null || true) + SHIM_INSTALLED_VER=$(PGPASSWORD="$PASSWORD" psql -h "$HOST" -p "$PORT" -U "$USER" -d "$DBNAME" -tAc \ + "SELECT latest_version FROM ir_module_module WHERE name='odoosky_hoot_dom_shim' AND state='installed'" 2>/dev/null || true) fi - if [ "$SHIM_INSTALLED" = "1" ]; then - echo "── odoosky_hoot_dom_shim already installed — skipping ──" - else - echo "── installing odoosky_hoot_dom_shim (hoot-dom workaround) ──" + # Manifest version is the source of truth — on bump, run -u + # so Odoo re-reads assets and regenerates affected bundles. + SHIM_MANIFEST_VER=$(awk -F"'" '/version/{print $4; exit}' /mnt/extra-addons/odoosky_hoot_dom_shim/__manifest__.py) + if [ -z "$SHIM_INSTALLED_VER" ]; then + echo "── installing odoosky_hoot_dom_shim ($SHIM_MANIFEST_VER) — hoot-dom workaround ──" odoo -i odoosky_hoot_dom_shim -d "$DBNAME" --stop-after-init --no-http \ --db_host="$HOST" --db_port="$PORT" --db_user="$USER" --db_password="$PASSWORD" \ --workers=0 \ --addons-path="/usr/lib/python3/dist-packages/odoo/addons,{{ .Values.addonsMountPath }}" + elif [ "$SHIM_INSTALLED_VER" != "$SHIM_MANIFEST_VER" ]; then + echo "── upgrading odoosky_hoot_dom_shim ($SHIM_INSTALLED_VER → $SHIM_MANIFEST_VER) ──" + odoo -u odoosky_hoot_dom_shim -d "$DBNAME" --stop-after-init --no-http \ + --db_host="$HOST" --db_port="$PORT" --db_user="$USER" --db_password="$PASSWORD" \ + --workers=0 \ + --addons-path="/usr/lib/python3/dist-packages/odoo/addons,{{ .Values.addonsMountPath }}" + else + echo "── odoosky_hoot_dom_shim $SHIM_INSTALLED_VER up-to-date — skipping ──" fi echo "── db-init done ──" env: