Skip to content

[Phase 2 preview] dms: OWL UX refinements (stacked on #475)#2

Closed
dnplkndll wants to merge 2 commits into
19.0-mig-dmsfrom
19.0-mig-dms-phase-2
Closed

[Phase 2 preview] dms: OWL UX refinements (stacked on #475)#2
dnplkndll wants to merge 2 commits into
19.0-mig-dmsfrom
19.0-mig-dms-phase-2

Conversation

@dnplkndll
Copy link
Copy Markdown

Preview of the phase 2 OWL/UX refinements that follow OCA/dms#475 (the minimal-viable 19.0 [MIG]).

Opened on ledoent fork against the phase 1 branch so the diff visible here is ONLY the phase 2 delta — easy to review without re-reading the 30 files of OCA#475. The merge target is intentionally ledoent/dms:19.0-mig-dms (not OCA upstream) until OCA#475 lands.

What's in this PR

  • Kanban buttons: drop classic dms.KanbanButtons (mobile-Scan + desktop-Upload), rewire buttonTemplate to the modern dms.FileKanbanView.Buttons (single Upload + t-ref hooks). Mobile-Scan UX intentionally dropped — dropzone covers it.
  • Breadcrumb modernisation: path_owl.xml switches from inline-style <a oe_form_uri> to Odoo 19's o_breadcrumb + breadcrumb-item Bootstrap idiom with aria-current="page".
  • Restore filter_domain on dms_category.xml: re-introduces the 18.0 UX of ('parent_id', 'child_of', raw_value) matching when typing a parent category's name. (Tag search left as default — 18.0's filter was equivalent to 19.0's default.)

Deferred to a later round

  • JS dead-code audit of attachment_image.esm.js / attachment_viewer_viewable.esm.js — verification inconclusive; keeping both until clearer signal.
  • Coverage closure (add coverage.py integration + tests for _search() override + _search_starred operator normalisation).
  • Code-style sweep (whitespace/indentation in storage.xml etc.).

Promotion path to OCA

Once OCA#475 merges and the dms 19.0.1.0.0 wheel publishes to PyPI:

  1. Rebase this branch onto OCA/dms:19.0 (Phase 1 commits absorbed).
  2. Convert this fork-internal PR into an OCA upstream draft PR (gh pr create --repo OCA/dms --base 19.0 --head ledoent:19.0-mig-dms-phase-2 --draft).
  3. OCA runboat picks it up; mark non-draft after a green build.

Runboat preview

Fork PRs don't get OCA runboat automatically. To preview the UX changes in a runboat-style build, either spin up a local 19.0 doodba with this branch checked out, or wait until step 2 above puts this on OCA's runboat.

- `dms_security_mixin`: override `_search()` to restore the access filter
  after 19.0's `Domain.optimize(basic)` bypass; update `_read_group` to
  the new aggregate-tuple return signature.
- `directory._search_starred`: handle the 19.0 Domain optimizer
  normalisation that turns `('starred', '=', True)` into
  `('starred', 'in', {True})`. Without this, starred-search returns the
  inverse set (test_starred fails).
- Switch `odoo.osv.expression` (`AND`/`OR`) to `odoo.fields.Domain`
  (`Domain.AND`/`Domain.OR`).
- Rename `auto_join` → `bypass_search_access` across one2many/many2one
  fields (10 sites).
- `res.users` references: `groups_id` → `group_ids` (m2m rename).
- `_sql_constraints` → `models.Constraint` declarations.
- Controllers: `@route(type='json')` → `@route(type='jsonrpc')`.
- Security: replace `category_id` with `privilege_id`; add the privilege
  records the 2-tier user/manager group structure expects.
- Demo data: `groups_id` → `group_ids` on `res.users` fixtures.
- Tests: add `require_demo_xmlid` helper so demo-dependent tests skip
  gracefully on CI (which runs without demo data).
- Translation calls in `directory.py` modernised to `self.env._()` to
  satisfy 19.0's pylint_odoo W8161/W8301 (co-located with the
  `_search_starred` fix; portal.py/test cleanup lives in `[IMP]`).
- Search view: drop deprecated `expand="0"` + `string="Group By"` from
  `<group>`; trivial XPath updates to OWL 2 templates.
- Portal tour: drop deprecated `test: true` flag; adapt step to the
  19.0 verify-only pattern.

Signed-off-by: Daniel Kendall <dkendall@ledoweb.com>
Follow-up to OCA#475 phase 1 (the minimal-viable 19.0 [MIG]). Opens on
the ledoent fork against the phase 1 branch so reviewers can preview the
delta on top of OCA#475 before it lands.

- **Breadcrumb modernisation**: replace `path_owl.xml`'s inline-style
  `<a oe_form_uri>` + `<span style="display: inline">` pattern with
  Odoo 19's `<ol class="o_breadcrumb breadcrumb"><li class="breadcrumb-item">`
  Bootstrap idiom. Final segment uses `class="breadcrumb-item active"`
  with `aria-current="page"` per Bootstrap a11y guidance.
- **Restore `filter_domain` on `dms_category.xml`** search view —
  `filter_domain="['|', ('name', 'ilike', self), ('parent_id', 'child_of', raw_value)]"`
  was removed in OCA#475 and re-introduces the 18.0 UX of filtering by parent
  category subtree when typing a parent's name. The bare 19.0 default
  `ilike` on name lost that behaviour. (Tag search left as default — 18.0's
  filter was equivalent to 19.0's default for that field.)

Originally this PR also rewired the kanban `buttonTemplate` from
`dms.KanbanButtons` to the orphan `dms.FileKanbanView.Buttons` template,
but that template uses invalid OWL inheritance syntax
(`<div role="toolbar" position="inside">` instead of `<xpath ...>`) AND
references controller hooks (`uploadFileInputRef`, `onFileInputChange`)
that don't exist on the controller. Reverted; phase 1's classic
`dms.KanbanButtons` template stays in place (it's now self-contained
without `t-inherit` since 19.0's `web.KanbanView.Buttons` is empty).

Deferred to a later round: JS dead-code audit (inconclusive — core 19.0
`LinkPreview` has no native `imageUrl` getter, so our patches may still be
load-bearing), coverage closure, and a proper kanban UX modernisation
once `dms.FileKanbanView.Buttons` is fixed or replaced.

Signed-off-by: Daniel Kendall <dkendall@ledoweb.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant