Skip to content

[20.0][MIG] document_page_access_group: Migration to 20.0 - #670

Open
bm1-phillip wants to merge 25 commits into
OCA:20.0from
BM1-de:20.0-mig-document_page_access_group
Open

bm1-phillip wants to merge 25 commits into
OCA:20.0from
BM1-de:20.0-mig-document_page_access_group

Conversation

@bm1-phillip

@bm1-phillip bm1-phillip commented Nov 14, 2026 •

Copy link
Copy Markdown

Migration of document_page_access_group to 20.0.

This one needs more than the usual changes, because the module relied on group-specific
ir.rule records to restrict what document_page grants. With ir.access, permissions
(records with a group) are OR-ed together, so adding a permission with a domain no longer
restricts anything while the unrestricted permission of document_page is active.

What the module does now (same pattern as hr_recruitment or sale_timesheet in Odoo core):

  • It disables document_page.document_page_user and document_page.document_page_editor.
  • It adds its own permissions for the same groups and operations, carrying the groups/users
    domain of the former rule (security/ir.access.csv).
  • Managers keep full access through document_page.document_page_manager, so the former
    "full access" rule is not needed any more.
  • An uninstall_hook enables the two permissions of document_page again.
  • On upgrade from 19.0, a post-migration script disables the two permissions as well: security/security.xml is a noupdate block, which Odoo skips when the records already exist, and document_page creates them active before this module is updated.

Other changes:

  • Tests: _test_user_groups = None, plus a test for the uninstall hook.
  • Removed the redundant string of groups_id (pylint attribute-string-redundant).

The domain itself is unchanged, including user.group_ids (explicitly assigned groups only).
I can follow up with a separate PR if user.all_group_ids is preferred.

Checked on a fresh Odoo 20 database with a reader, an editor and a manager: pages without
groups are visible to everyone, pages with a group only to its members, editors can only
modify what they can read, managers see and edit everything.

Migration issue: #650

🤖 Generated with Claude Code

manuelregidor and others added 24 commits November 14, 2026 09:14
Currently translated at 100.0% (6 of 6 strings)

Translation: knowledge-14.0/knowledge-14.0-document_page_access_group
Translate-URL: https://translation.odoo-community.org/projects/knowledge-14-0/knowledge-14-0-document_page_access_group/it/
Currently translated at 100.0% (6 of 6 strings)

Translation: knowledge-14.0/knowledge-14.0-document_page_access_group
Translate-URL: https://translation.odoo-community.org/projects/knowledge-14-0/knowledge-14-0-document_page_access_group/es/
Currently translated at 100.0% (5 of 5 strings)

Translation: knowledge-17.0/knowledge-17.0-document_page_access_group
Translate-URL: https://translation.odoo-community.org/projects/knowledge-17-0/knowledge-17-0-document_page_access_group/it/
Currently translated at 100.0% (5 of 5 strings)

Translation: knowledge-17.0/knowledge-17.0-document_page_access_group
Translate-URL: https://translation.odoo-community.org/projects/knowledge-17-0/knowledge-17-0-document_page_access_group/ca/
@oca-cla-bot

oca-cla-bot Bot commented Nov 14, 2026 •

Copy link
Copy Markdown

All commit authors signed the Contributor License Agreement.

CLA signed

@OCA-git-bot OCA-git-bot added mod:document_page_access_group Module document_page_access_group series:20.0 labels Nov 14, 2026
@bm1-phillip
bm1-phillip force-pushed the 20.0-mig-document_page_access_group branch from 81474d2 to 74f0efe Compare November 14, 2026 09:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mod:document_page_access_group Module document_page_access_group series:20.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.