Skip to content

[16.0][FIX] document_page_reference: migrate widget to OWL#622

Open
dnplkndll wants to merge 3 commits into
OCA:16.0from
ledoent:16.0-fix-document_page_reference-owl
Open

[16.0][FIX] document_page_reference: migrate widget to OWL#622
dnplkndll wants to merge 3 commits into
OCA:16.0from
ledoent:16.0-fix-document_page_reference-owl

Conversation

@dnplkndll

@dnplkndll dnplkndll commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Supersedes #601 (rebased on current 16.0 + index.html regen). Original work by @IJOL.

The legacy web.field_registry widget isn't picked up by the OWL form parser, so content_parsed renders raw ${reference} text instead of clickable links. This migrates the widget to OWL (registry.category("fields") + HtmlField), replaces the oe_read_only/oe_edit_only CSS toggle (dead in OWL forms) with readonly="1"/invisible, strips the target="_blank" that retargetLinks adds to internal links, and fixes a Markup escaping case in _get_page_index.

Depends on #623. The red pre-commit is the branch-wide setuptools-odoo pkg_resources break, not this change — it clears once #623 (copier update v1.43, bumps setuptools-odoo 3.1.8 → 3.3.2) lands and CI re-runs. Tests + runboat are green here; codecov is informational.

IJOL and others added 3 commits June 19, 2026 11:13
The legacy JS widget registered in web.field_registry was not picked up
by the OWL form view parser, causing "Missing widget:
document_page_reference" warnings and the content_parsed field not
rendering at all.

Changes:
- Migrate JS widget from legacy field_registry to OWL registry
- Fix retargetLinks adding target="_blank" to internal reference links
- Override _get_page_index to use oe_direct_line links in category pages
- Replace oe_read_only/oe_edit_only CSS classes with proper attrs/invisible
- Add tour test for reference link navigation
- Fix _compute_content_parsed using self instead of record in loop
html_escape() returns markupsafe.Markup, which auto-escapes plain str
when concatenated. Use Markup() for HTML literals to prevent the index
links from being double-escaped.

Also add sanitize=False to content_parsed field to match content field.
Co-authored-by: Ignacio J. Ortega <nacho.ortega@gmail.com>
@OCA-git-bot

Copy link
Copy Markdown
Contributor

Hi @etobella,
some modules you are maintaining are being modified, check this out!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mod:document_page_reference Module document_page_reference series:16.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants