Skip to content

[18.0][MIG] document_page_portal - #615

Open
kwoychesko wants to merge 7 commits into
OCA:18.0from
bpmi:18.0-mig-document_page_portal
Open

[18.0][MIG] document_page_portal#615
kwoychesko wants to merge 7 commits into
OCA:18.0from
bpmi:18.0-mig-document_page_portal

Conversation

@kwoychesko

Copy link
Copy Markdown

Migration of document_page_portal to 18.0. Part of #499.

Changes during migration (beyond the mechanical pass)

  • Removed the deprecated <data> node; t-rawt-out; Bootstrap 4 → 5 classes.
  • Moved frontend assets from views/assets.xml to the manifest assets key.
  • Rewrote the JS tour to an ESM module + the web_tour.tours registry API; the Python tests now use start_tour.
  • Fixed the group external id knowledge.group_document_userdocument_knowledge.group_document_user.
  • Updated the portal My Home card to the v17+ placeholder_count pattern (it was rendering hidden).
  • Replaced the removed portal.portal_record_layout with an inline card.
  • Modernised the backend "edit" link from /web#… to /odoo/document.page/<id>.

A separate [IMP] commit improves the README (clearer DESCRIPTION/USAGE, fixed CREDITS link).

Tested locally on 18.0: the module installs cleanly and both portal tours pass in a headless browser.

@OCA-git-bot OCA-git-bot added series:18.0 mod:document_page_portal Module document_page_portal labels May 26, 2026
@kwoychesko

Copy link
Copy Markdown
Author

@marcelsavegnago — thanks in advance for reviewing 🙏

A heads-up on the red test jobs: the module installs cleanly and all 71 tests pass — both portal tours log TOUR … SUCCEEDED. The build fails on the log-error gate, which trips on a Chrome teardown warning from the two HttpCase tours:

WARNING … TestPortalDocumentPage.test_01_document_page_portal_tour: Killing chrome descendants-or-self of 328: 5 remaining
- chrome (zombie) x5

These are unreaped Chrome child processes in the CI container during HttpCase cleanup (odoo/tests/common.py), not a test failure — the tours themselves succeed. Since oca-ci fails the build on any warning (OCA/oca-ci#89), this blocks it.

Is this a known issue with browser tours in the current image (possibly Chrome-version related, cf. OCA/oca-ci#122)? Happy to adjust the tests if you'd prefer a different approach (e.g. HTTP-level checks instead of full browser tours). Thanks!

@dnplkndll

Copy link
Copy Markdown
Contributor

@kaynnan @pedrobaeza this should run clean now on a rebase / rerun ?

@kaynnan

kaynnan commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

@dnplkndll From what I see, yes, the rebase would already solve the tests that failed

@kwoychesko
kwoychesko force-pushed the 18.0-mig-document_page_portal branch from caa396d to 832a07b Compare June 19, 2026 15:05
@kwoychesko

Copy link
Copy Markdown
Author

@dnplkndll @kaynnan thanks for taking a look 🙏 Rebased onto the latest 18.0 (which pulls in the copier-update v1.43 CI/template bump) and force-pushed — CI is re-running now. The module commits replayed cleanly with no changes to the module itself. Hopefully this clears the earlier Chrome-teardown warning that was tripping the log-error gate. 🤞

@kaynnan

kaynnan commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

ping @pedrobaeza

@pedrobaeza

Copy link
Copy Markdown
Member

/ocabot migration document_page_portal

@OCA-git-bot OCA-git-bot added this to the 18.0 milestone Jun 19, 2026
@OCA-git-bot OCA-git-bot mentioned this pull request Jun 19, 2026
13 tasks
@kaynnan

kaynnan commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

@kwoychesko Can you improve the testing percentage?

Cover the portal controller branches the browser tours do not exercise:
the access-denied / missing-record redirect in document_pages_followup,
and the date_begin/date_end filter of the document list. These use
url_open (no browser), so coverage rises without adding Chrome tours.
@kwoychesko

Copy link
Copy Markdown
Author

@kaynnan Added HTTP-level controller tests (url_open, no browser) covering the branches the tours didn't reach: the access-denied and missing-record redirects in document_pages_followup, plus the date_begin/date_end filter on the document list. Codecov patch is now 97.80% (target 95.95%) and project is +0.11%. Kept these browser-free so they don't reintroduce the earlier Chrome teardown warning.

@chrisandrewmann

chrisandrewmann commented Aug 12, 2026

Copy link
Copy Markdown

@kwoychesko thanks for your efforts on this.
Just done a quick test. Couple of things:

  1. Search doesn't work and currently shows "Search <span class" in box but doesn't respect what term is entered.
image 2. Since v17 all sections have icons. I'd recommend you use the same icon from the homescreen of document_knowledge? IMO it looks odd not to have one for Knowledge. https://github.com/OCA/knowledge/blob/18.0/document_knowledge/static/description/icon.svg image

@tonygalmiche tonygalmiche 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.

Functional review

Tested on a local Odoo 18.0 instance:

  • Public pages correctly appear on the portal ("Knowledge Documents"), and private pages correctly follow the follower-based visibility.
  • Category badges display correctly.

Found and confirmed 2 bugs in controllers/portal.py:

  1. Search bar doesn't filter anything — typing any search term still returns all pages. Root cause: search_domain starts as [] (matches everything) and gets OR-ed with the real condition, which always matches everything regardless of the search term:

search_domain = []
if search_in in ("content", "all"):
search_domain = OR(
[
search_domain,
["|", ("name", "ilike", search), ("content", "ilike", search)],
]
)
domain += search_domain

  1. The search bar label displays raw HTML as literal text instead of rendering it, because the string is not marked safe:

"label": _('Search (in Content)'),

Confirmed fix for both (tested locally, works correctly):

from markupsafe import Markup
...
searchbar_inputs = {
"content": {
"input": "content",
"label": Markup(_('Search (in Content)')),
},
"all": {"input": "all", "label": _("Search in All")},
}
...

search

if search and search_in in ("content", "all"):
domain += ["|", ("name", "ilike", search), ("content", "ilike", search)]

Request changes with the fix above.

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

Labels

mod:document_page_portal Module document_page_portal series:18.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants