Skip to content

[18.0][FIX] enable document reference link generation#609

Open
KDRdev wants to merge 1 commit intoOCA:18.0from
Nitrokey:18.0-fix_document_page_reference_link
Open

[18.0][FIX] enable document reference link generation#609
KDRdev wants to merge 1 commit intoOCA:18.0from
Nitrokey:18.0-fix_document_page_reference_link

Conversation

@KDRdev
Copy link
Copy Markdown

@KDRdev KDRdev commented Apr 22, 2026

Currently referencing other documents with {{SOME_REF}} won't result in showing this as a link.

This PR addresses with issue and allows showing link after saving the document.

@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 labels Apr 22, 2026
@etobella
Copy link
Copy Markdown
Member

TEsts are failing and use a proper commit description

@KDRdev KDRdev changed the title Fix for document reference link [18.0][FIX] Document reference link Apr 22, 2026
@KDRdev KDRdev changed the title [18.0][FIX] Document reference link [18.0][FIX] document reference link Apr 22, 2026
@KDRdev KDRdev marked this pull request as draft April 22, 2026 13:24
@KDRdev KDRdev force-pushed the 18.0-fix_document_page_reference_link branch from 481ab4f to 9dc26a2 Compare April 22, 2026 13:35
@KDRdev KDRdev marked this pull request as ready for review April 22, 2026 13:39
@KDRdev
Copy link
Copy Markdown
Author

KDRdev commented Apr 22, 2026

@etobella Tests have been fixed

@KDRdev KDRdev changed the title [18.0][FIX] document reference link [18.0][FIX] enable document reference link generation Apr 22, 2026
Before this change adding reference to another document with {{SOME_REF}} won't transform this to a link as described in README. Now after saving the document with valid reference, it will be shown as a link to related document.
@KDRdev KDRdev force-pushed the 18.0-fix_document_page_reference_link branch from 9dc26a2 to d1f40cf Compare April 22, 2026 14:09
self.page1.content = Markup("<p></p>")
self.assertEqual(self.page1.content_parsed, Markup("<p></p>"))
self.page1.content = Markup("<p>{{r2}}</p>")
self.page1._compute_content_parsed()
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.

You shouldn't need to execute compute functions

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

You're right. Will remove unnecessary lines



class TestDocumentReference(BaseCommon):
class TestDocumentReference(TransactionCase):
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.

Why did you change it back to Transactioncase? wasn't BaseCommon working?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Yes, I was getting not-null constraint error: null value in column "autopost_bills" of relation "res_partner" violates not-null constraint when using BaseCommon. With TransactionCase it works.

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.

That probably happens because you installed several modules and this was providing a problem with that. LEave it as it was please 🙏

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:18.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants