Skip to content

[18.0][IMP] document_page_reference: split linking feature into document_page_reference_link#631

Open
miquelrosell99 wants to merge 2 commits into
OCA:18.0from
miquelrosell99:18.0-add-document_page_reference_link
Open

[18.0][IMP] document_page_reference: split linking feature into document_page_reference_link#631
miquelrosell99 wants to merge 2 commits into
OCA:18.0from
miquelrosell99:18.0-add-document_page_reference_link

Conversation

@miquelrosell99

Copy link
Copy Markdown

Motivation

document_page_reference currently bundles two independent concerns:

  1. the reference field on document.page (validation, uniqueness, auto-generation from the name, views);
  2. the linking feature built on top of it: content_parsed, {{reference}} marker resolution into direct links, the report override, and the backend editor JS.

Some deployments want the field without the linking feature — either because they don't need it, or because they prefer a different linking implementation. Today that is not possible without uninstalling the whole module.

Changes

  • document_page_reference (18.0.3.0.0): keeps the reference field, its validation/auto-generation, and the form/search/list views. All linking code is removed.
  • document_page_reference_link (new): contains everything that was moved out — content_parsed, {{ref}} resolution, report override, editor JS — with no behavior changes. Depends on document_page_reference.

All moved code (model methods, views, JS, tests) is byte-identical to the original; the diff is a pure code motion split.

Upgrade path

  • Updating document_page_reference alone removes the linking feature (the stored content_parsed column is dropped). To keep current behavior, install document_page_reference_link — the column is recreated and recomputed automatically on install.
  • The reference field itself is unaffected (same model, same name): no data migration needed.

Notes

  • Nothing else in this repo depends on document_page_reference or its view XML IDs, so the split is safe repo-internally.
  • I kept @etobella as maintainer of the new module and added myself as co-maintainer — happy to adjust.

…reference_link

Keep only the reference field (validation, uniqueness, auto-generation
and views) in this module, so deployments that want the field without
the {{reference}} linking feature (or with their own linking approach)
can use it standalone.

The linking feature (content_parsed, marker resolution, report override
and editor JS) moves to the new document_page_reference_link module.
Install it to keep the previous behavior; content_parsed is recreated
and recomputed automatically on install.
New module with the linking feature moved out of
document_page_reference: content_parsed, {{reference}} marker
resolution into direct links, report override and backend editor JS.
Code moved as-is, no behavior changes.
@OCA-git-bot

Copy link
Copy Markdown
Contributor

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

@OCA-git-bot OCA-git-bot added series:18.0 mod:document_page_reference Module document_page_reference mod:document_page_reference_link Module document_page_reference_link labels Jul 15, 2026
@etobella

Copy link
Copy Markdown
Member

@miquelrosell99 I understand your need, however, the changes required to add the link are minimal and doesn't affect to first module, so it has sense to use them together, at the end, the user can decide not to make links, isn't it?

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

Labels

mod:document_page_reference_link Module document_page_reference_link mod:document_page_reference Module document_page_reference series:18.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants