metatroncubeswdev 5596f41377 fix(tncsc_deployment): grant admin the Board Admin role so CommunityOS apps show
Every product module's backend app (Membership, School, Benefits,
Classifieds, Interac Payments) has its root menu restricted to its own
manager/coordinator group. A fresh tncsc_deployment install left the
admin user in none of them, so admin's app switcher only showed stock
apps (Events, eLearning, ...) - which looks exactly like the modules
weren't installed, even though ir.module.module.state is 'installed' for
all of them (menu visibility is group-based, not install-state-based).

Fixed by seeding admin into tncsc_deployment.group_tncsc_board_admin,
whose implied_ids already cover every product manager group - this
automates what Phase 8 previously described doing by hand for just the
School Coordinator group. Verified on a fresh install: admin's visible
root menus now include Membership/School/Benefits/Classifieds/Interac
Payments alongside the stock apps, tests still 9/9.

Also documents in HANDOFF.md that `user in group.user_ids` doesn't see
implied-group membership - use has_group() instead, which resolves the
transitive closure correctly.
2026-08-21 18:59:34 -04:00

80 lines
4.1 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<odoo noupdate="1">
<!-- TNCSC-branded role names. Each is a thin wrapper implying the
generic product-layer groups - the actual access control logic
lives entirely in the community_* modules; these just give board
members role labels they recognize in Settings > Users. -->
<record id="module_category_tncsc_roles" model="ir.module.category">
<field name="name">TNCSC Roles</field>
<field name="sequence">5</field>
</record>
<record id="privilege_tncsc_roles" model="res.groups.privilege">
<field name="name">TNCSC Roles</field>
<field name="category_id" ref="module_category_tncsc_roles"/>
</record>
<record id="group_tncsc_board_admin" model="res.groups">
<field name="name">Board Admin</field>
<field name="privilege_id" ref="privilege_tncsc_roles"/>
<field name="comment">Full access across membership, school, classifieds, benefits, events, and Interac payments.</field>
<field name="implied_ids" eval="[
(4, ref('community_membership.group_membership_manager')),
(4, ref('community_school.group_school_coordinator')),
(4, ref('community_classifieds.group_classifieds_moderator')),
(4, ref('community_benefits.group_benefits_manager')),
(4, ref('community_interac.group_interac_verifier')),
(4, ref('event.group_event_manager')),
]"/>
<!-- Without this, a fresh install leaves the installing admin user
out of every product-module manager group, so their backend
app switcher only shows stock apps (Events, eLearning, ...)
and none of the CommunityOS ones - each app's root menu is
group-restricted and admin isn't a member of any of those
groups by default. Confirmed empirically against a live
container; this is the automated fix for the manual step
HANDOFF.md previously described doing by hand for the School
Coordinator group alone. -->
<field name="user_ids" eval="[(4, ref('base.user_admin'))]"/>
</record>
<record id="group_tncsc_treasurer" model="res.groups">
<field name="name">Treasurer</field>
<field name="privilege_id" ref="privilege_tncsc_roles"/>
<field name="comment">Confirms Interac e-Transfer payments and manages accounting.</field>
<field name="implied_ids" eval="[
(4, ref('community_interac.group_interac_verifier')),
(4, ref('account.group_account_invoice')),
]"/>
</record>
<record id="group_tncsc_events_officer" model="res.groups">
<field name="name">Events Officer</field>
<field name="privilege_id" ref="privilege_tncsc_roles"/>
<field name="comment">Manages events and staffs the check-in desk.</field>
<field name="implied_ids" eval="[(4, ref('event.group_event_manager'))]"/>
</record>
<record id="group_tncsc_school_coordinator" model="res.groups">
<field name="name">School Coordinator</field>
<field name="privilege_id" ref="privilege_tncsc_roles"/>
<field name="comment">Manages Tamil School terms, classes, students, and enrollment.</field>
<field name="implied_ids" eval="[(4, ref('community_school.group_school_coordinator'))]"/>
</record>
<record id="group_tncsc_teacher" model="res.groups">
<field name="name">Teacher</field>
<field name="privilege_id" ref="privilege_tncsc_roles"/>
<field name="comment">Takes attendance for their own Tamil School classes.</field>
<field name="implied_ids" eval="[(4, ref('community_school.group_school_teacher'))]"/>
</record>
<record id="group_tncsc_classifieds_moderator" model="res.groups">
<field name="name">Classifieds Moderator</field>
<field name="privilege_id" ref="privilege_tncsc_roles"/>
<field name="comment">Reviews and publishes classified listings.</field>
<field name="implied_ids" eval="[(4, ref('community_classifieds.group_classifieds_moderator'))]"/>
</record>
</odoo>