[FIX] web_responsive: target env.isSmall in apps_menu xpath#3552
Open
Adrian016 wants to merge 1 commit into
Open
[FIX] web_responsive: target env.isSmall in apps_menu xpath#3552Adrian016 wants to merge 1 commit into
Adrian016 wants to merge 1 commit into
Conversation
The xpath inheritance in web_responsive's apps_menu.xml is targeting
`t-if='this.ui.isSmall'`, but the base Odoo 18 web.NavBar.AppsMenu
template uses `t-if='env.isSmall'` (see addons/web/static/src/webclient/
navbar/navbar.xml). The xpath therefore matches no element and the
inheritance silently no-ops — the responsive apps menu falls back to
the standard navbar behaviour and the customisations in this file
are never applied.
This is a residue from the Odoo 17 -> 18 port: Odoo 17 exposed the
small-screen flag via `useService("ui").isSmall`, while Odoo 18 moved
it onto the env as `env.isSmall`. Other web_responsive files were
updated; this one was missed.
Two-line change: swap the xpath target and the t-if expression to use
`env.isSmall`, matching the base template.
Symptom seen by users: web_responsive installed and shown as enabled,
but the responsive apps menu (and its sidebar/dropdown swap) does not
take effect on small screens.
Signed-off-by: Adrian <[email protected]>
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Symptom
web_responsiveinstalls cleanly on Odoo 18 CE, but the responsive apps-menu behaviour (sidebar / dropdown swap on small screens) never takes effect — the standardweb.NavBar.AppsMenutemplate is rendered unchanged.Root cause
web_responsive/static/src/components/apps_menu/apps_menu.xmlextendsweb.NavBar.AppsMenuwith two xpath expressions targetingt-if='this.ui.isSmall'. The base Odoo 18 template usest-if='env.isSmall'(addons/web/static/src/webclient/navbar/navbar.xml). The xpath targets therefore match nothing and both customisations silently no-op.This is a residue from the Odoo 17 → 18 port: Odoo 17 exposed the small-screen flag via
useService(\"ui\").isSmall; Odoo 18 moved it onto the env asenv.isSmall. Otherweb_responsivefiles were updated for the new pattern — this one was missed.Fix
Two-line change: swap the xpath target and the
t-ifexpression to useenv.isSmall, matching the base template.```diff
```
How to verify
18.0web_responsiveon a fresh Odoo 18 CE DB< 768px) or open the web client in a mobile emulator