Skip to content

[MIG] base_import_mobile_ux: Migration to 20.0 - #498

Closed
mav-adhoc wants to merge 3 commits into
ingadhoc:20.0from
adhoc-dev:20.0-t-76811-mav
Closed

mav-adhoc wants to merge 3 commits into
ingadhoc:20.0from
adhoc-dev:20.0-t-76811-mav

Conversation

@mav-adhoc

Copy link
Copy Markdown
Contributor

Migrates base_import_mobile_ux from 19.0 to 20.0.

Tarea: https://www.adhoc.inc/odoo/project.task/76811

What the jump broke, and why nothing failed

The module re-registers the "Import records" cog menu item so that it also shows on
small screens, where core hides it.

In 19.0 core decided that with isDisplayed: ({ config, isSmall }) => !isSmall && ...
(base_import/static/src/import_records/import_records.js:42-43), reading isSmall
off the env, so the module only had to call core's own isDisplayed with a shadowed
env.

In 20.0 that no longer works, for two reasons:

  • env.isSmall was removed. makeEnv() now returns a Proxy that raises on it:
    "env.isSmall" was removed when the ui service became UIPlugin
    (web/static/src/env.js:16-44).
  • The check reads the ui service instead (import_records.js:39-50), and
    useService resolves from the scope's env, not from the argument it is given
    (web/static/src/core/utils/hooks.js:158).

So the shadowed env still arrives and nobody reads it. The module installs, raises no
error, breaks no test — and silently stops having any effect.

The fix

Core's condition is repeated here without the small-screen check, which is what
esg does in 20.0 (esg/static/src/components/cog_menu/esg_import_menu.js:10-24).
It cannot be delegated without faking the ui service, which is global.

The view type list follows core and gains grid (import_records.js:46), which is
core's own criterion and the one the module always delegated to.

The README says why the condition is repeated, so that it is kept in sync.

Test plan

On a narrow viewport (375x667), in a list where creating records is allowed:

  1. The actions (cog) menu includes the import entry — in 19.0 it did too.
  2. In a list whose view declares create="0" the entry is absent, in both versions:
    the module lifts only the small-screen guard, not the rest of core's criteria.

Checked on a local 20.0 database with a declarative browser script, against three
combinations: 19.0 with the 19.0 code, 20.0 with the 19.0 code (entry gone, no JS
errors) and 20.0 with this code (entry back).

Notes for the reviewer

  • depends and auto_install are unchanged; only version and installable move,
    both from the migrator.
  • upgrade_code ran every script of the jump: no file changed.
  • The module has no tests/, so there is no regression net; it was migrated without
    one on purpose, and the behaviour above was verified on screen instead.
  • i18n/ is new: from 20.0 the export also brings the module card. Its name and
    summary are translated; the description is the whole README and stays untranslated.
  • No data migration script is needed: the module declares no models, fields or data.

The module re-registers the "Import records" cog menu item so that it also
shows on small screens, where core hides it.

In 19.0 core read `isSmall` off the env, so the module could delegate to
core's `isDisplayed` with a shadowed env. In 20.0 `env.isSmall` is gone
(web/static/src/env.js:21-24) and the check reads the `ui` service through
`useService`, which resolves from the scope's env and not from the argument
(web/static/src/core/utils/hooks.js:158). The old code still loads and still
passes, but it no longer has any effect: the item stays hidden.

Core's condition is repeated here without the small-screen check, the same
way enterprise's esg module does it in 20.0. The view type list follows core
and gains "grid"
(base_import/static/src/import_records/import_records.js:46).
…odule card

The module had no i18n/ folder. From 20.0 the export also brings the module
card, so the .pot and the es.po are created here with its name and summary
translated. The description is the whole README and stays untranslated.
@roboadhoc

Copy link
Copy Markdown
Contributor

Pull request status dashboard

…mport» and drop «list view»

The core item is called «Import» in 20.0 (base_import import_records.xml),
and the module also covers kanban and grid, so the summary no longer
says list view. The .pot and es.po follow.
@les-adhoc

Copy link
Copy Markdown
Contributor

@roboadhoc r+ nobump rebase-ff

@roboadhoc

Copy link
Copy Markdown
Contributor

Merge method set to rebase and fast-forward.

roboadhoc pushed a commit that referenced this pull request Nov 12, 2026
The module re-registers the "Import records" cog menu item so that it also
shows on small screens, where core hides it.

In 19.0 core read `isSmall` off the env, so the module could delegate to
core's `isDisplayed` with a shadowed env. In 20.0 `env.isSmall` is gone
(web/static/src/env.js:21-24) and the check reads the `ui` service through
`useService`, which resolves from the scope's env and not from the argument
(web/static/src/core/utils/hooks.js:158). The old code still loads and still
passes, but it no longer has any effect: the item stays hidden.

Core's condition is repeated here without the small-screen check, the same
way enterprise's esg module does it in 20.0. The view type list follows core
and gains "grid"
(base_import/static/src/import_records/import_records.js:46).

Part-of: #498
Signed-off-by: Luciano Esperlazza <[email protected]>
roboadhoc pushed a commit that referenced this pull request Nov 12, 2026
…odule card

The module had no i18n/ folder. From 20.0 the export also brings the module
card, so the .pot and the es.po are created here with its name and summary
translated. The description is the whole README and stays untranslated.

Part-of: #498
Signed-off-by: Luciano Esperlazza <[email protected]>
roboadhoc pushed a commit that referenced this pull request Nov 12, 2026
…mport» and drop «list view»

The core item is called «Import» in 20.0 (base_import import_records.xml),
and the module also covers kanban and grid, so the summary no longer
says list view. The .pot and es.po follow.

closes #498

Signed-off-by: Luciano Esperlazza <[email protected]>
roboadhoc pushed a commit that referenced this pull request Nov 12, 2026
The module re-registers the "Import records" cog menu item so that it also
shows on small screens, where core hides it.

In 19.0 core read `isSmall` off the env, so the module could delegate to
core's `isDisplayed` with a shadowed env. In 20.0 `env.isSmall` is gone
(web/static/src/env.js:21-24) and the check reads the `ui` service through
`useService`, which resolves from the scope's env and not from the argument
(web/static/src/core/utils/hooks.js:158). The old code still loads and still
passes, but it no longer has any effect: the item stays hidden.

Core's condition is repeated here without the small-screen check, the same
way enterprise's esg module does it in 20.0. The view type list follows core
and gains "grid"
(base_import/static/src/import_records/import_records.js:46).

Part-of: #498
Signed-off-by: Luciano Esperlazza <[email protected]>
roboadhoc pushed a commit that referenced this pull request Nov 12, 2026
…odule card

The module had no i18n/ folder. From 20.0 the export also brings the module
card, so the .pot and the es.po are created here with its name and summary
translated. The description is the whole README and stays untranslated.

Part-of: #498
Signed-off-by: Luciano Esperlazza <[email protected]>
@roboadhoc roboadhoc added the 19.1 label Nov 12, 2026
@roboadhoc roboadhoc closed this in 773826a Nov 12, 2026
@roboadhoc
roboadhoc deleted the 20.0-t-76811-mav branch November 12, 2026 18:06

This branch was previously deployed

1 inactive deployment
merge — 8875b4bc Deployed Nov 12, 2026 by roboadhoc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants