Skip to content

[19.0][MIG] document_page_reference - #626

Open
dnplkndll wants to merge 27 commits into
OCA:19.0from
ledoent:19.0-fix-document_page_reference
Open

dnplkndll wants to merge 27 commits into
OCA:19.0from
ledoent:19.0-fix-document_page_reference

Conversation

@dnplkndll

@dnplkndll dnplkndll commented Jun 19, 2026 •

Copy link
Copy Markdown
Contributor

Port of document_page_reference from 18.0 to 19.0.

Supersedes #589 (stale since 2026-05-05) — same replayed history + @gregory-rutecki's [MIG], rebased on current 19.0, plus two fixes that make the reference-link feature actually work in 19.0:

  • _resolve_reference returns Markup(...) again (the port dropped it, so 19.0 Markup.replace HTML-escaped the anchor → links rendered as escaped text).
  • content_parsed shown via readonly="1" + invisible/required instead of the dead oe_read_only/oe_edit_only toggle (no readonly mode in OWL forms → field was display:none). Verified on a runboat build: the resolved link now renders and is clickable.

AI-assisted (Claude Code); every change reviewed, tested, and owned by the author.

@OCA-git-bot OCA-git-bot added series:19.0 mod:document_page_reference Module document_page_reference labels Jun 19, 2026
mtelahun and others added 18 commits June 22, 2026 14:34
[UPD] Update document_page_reference.pot

[UPD] README.rst
also, make reference optional in tree view and not the first field.
Currently translated at 100.0% (7 of 7 strings)

Translation: knowledge-15.0/knowledge-15.0-document_page_reference
Translate-URL: https://translation.odoo-community.org/projects/knowledge-15-0/knowledge-15-0-document_page_reference/it/
Currently translated at 100.0% (7 of 7 strings)

Translation: knowledge-15.0/knowledge-15.0-document_page_reference
Translate-URL: https://translation.odoo-community.org/projects/knowledge-15-0/knowledge-15-0-document_page_reference/it/
Currently translated at 100.0% (7 of 7 strings)

Translation: knowledge-15.0/knowledge-15.0-document_page_reference
Translate-URL: https://translation.odoo-community.org/projects/knowledge-15-0/knowledge-15-0-document_page_reference/it/
Currently translated at 100.0% (7 of 7 strings)

Translation: knowledge-16.0/knowledge-16.0-document_page_reference
Translate-URL: https://translation.odoo-community.org/projects/knowledge-16-0/knowledge-16-0-document_page_reference/es/
Currently translated at 100.0% (7 of 7 strings)

Translation: knowledge-16.0/knowledge-16.0-document_page_reference
Translate-URL: https://translation.odoo-community.org/projects/knowledge-16-0/knowledge-16-0-document_page_reference/pt/
[FIX]document_page_reference :log warning updated

[FIX]document_page_reference: null value issue fixed
@dnplkndll
dnplkndll force-pushed the 19.0-fix-document_page_reference branch from bb08bb8 to e0ba6b4 Compare June 22, 2026 18:34

@MiquelRForgeFlow MiquelRForgeFlow left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code LGTM

@CarlosRoca13 CarlosRoca13 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code and functional review 👍

TT64100

ping @pedrobaeza

@OCA-git-bot

Copy link
Copy Markdown
Contributor

This PR has the approved label and has been created more than 5 days ago. It should therefore be ready to merge by a maintainer (or a PSC member if the concerned addon has no declared maintainer). 🤖

@pedrobaeza pedrobaeza left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/ocabot migration document_page_reference

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this file

Comment thread document_page_reference/__manifest__.py Outdated
"name": "Document Page Reference",
"summary": """
Include references on document pages""",
"version": "19.0.2.1.0",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"version": "19.0.2.1.0",
"version": "19.0.1.0.0",

@OCA-git-bot OCA-git-bot added this to the 19.0 milestone Sep 22, 2026
@OCA-git-bot OCA-git-bot mentioned this pull request Sep 22, 2026
9 of 11 tasks
gregory-rutecki and others added 3 commits September 22, 2026 07:54
19.0 Html fields return Markup; Markup.replace(token, plain_str) escapes the
injected anchor, so content_parsed stored the <a> as literal text and no
.oe_direct_line element rendered. Restore 18.0's get_content shape: seed with
Markup(raw), return Markup() from _resolve_reference (+ backend_url href and the
second pass that re-resolves already-rendered links). Bind the click handler via
one delegated useExternalListener instead of per-node onMounted listeners.

Assisted-by: Claude Fable 5
Replace the dead oe_read_only/oe_edit_only CSS toggle (an open record is always
o_form_editable in OWL, so content_parsed never showed) with readonly content_parsed
+ invisible/required content. Companion to the Markup-render fix.

Assisted-by: Claude Fable 5
@dnplkndll
dnplkndll force-pushed the 19.0-fix-document_page_reference branch from e0ba6b4 to 1d3012c Compare September 22, 2026 12:06
adminde added a commit to oros-energy/oca-knowledge that referenced this pull request Oct 15, 2026
No OCA pull request for 20.0 exists. The history above is the head of
OCA#626 ([19.0][MIG] document_page_reference, open, approved
twice, supersedes OCA#589) replayed with git format-patch and git am,
followed by the 18.0 commits that OCA#626 does not contain yet (fix OCA#609 for
reference links in the content, the report fix and the fr, gl and sl
translations), cherry-picked with their authors. Model, tests and
translations now match the static Oros port, which came from 18.0. View
and widget keep the 19.0 fixes of OCA#626, which the port lacks.

* Odoo 20 renamed BaseModel.get_formview_action() to
  get_record_default_action(). The override moves to the new name and
  get_formview_action() stays as an alias, because the reference links
  call it over RPC. The port built the action by hand instead.
* Owl 3 has no useExternalListener any more. The widget uses useListener,
  which also removes the listener when the field is destroyed.
* reference is copy=False. Otherwise copying a page fails on the unique
  reference (test_page_copy of document_page fails with this module
  installed). Taken from the port.
* Tests: BaseCommon in 20.0 runs each test as a user with only
  base.group_user. The tests keep the superuser environment of 19.0 with
  _test_user_groups = (). Taken from the port.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.