metatroncubeswdev 4a2e7b7016 fix: admin group membership on install, and db_name breaking the db list
- group_school_administrator now includes base.user_admin, matching
  core Odoo's own convention (see hr.group_hr_manager) - otherwise
  every fresh install requires a manual trip to Settings > Users just
  to see this module's own menus.
- odoo.conf: drop db_name. Found by hand while testing: when db_name
  is set and dbfilter is not, Odoo's list_dbs() returns db_name's
  value verbatim instead of querying postgres, so the database
  selector shows only that one database no matter how many actually
  exist. Silently breaks O9's "swap to the second demo school in
  under five minutes" requirement, which depends on switching between
  multiple real databases.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-11 11:25:37 -04:00

64 lines
3.1 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="module_category_school" model="ir.module.category">
<field name="name">School Management</field>
<field name="sequence">20</field>
</record>
<!-- Odoo 19: res.groups no longer has category_id directly; groups are
grouped under a res.groups.privilege, which carries the category. -->
<record id="privilege_school" model="res.groups.privilege">
<field name="name">School Management</field>
<field name="category_id" ref="module_category_school"/>
<field name="sequence">20</field>
</record>
<!-- Internal (backend) roles -->
<record id="group_school_staff" model="res.groups">
<field name="name">School Staff</field>
<field name="privilege_id" ref="privilege_school"/>
<field name="comment">Front office and general staff: read access to academic structure and student records.</field>
</record>
<record id="group_teacher" model="res.groups">
<field name="name">Teacher</field>
<field name="privilege_id" ref="privilege_school"/>
<field name="implied_ids" eval="[(4, ref('group_school_staff'))]"/>
<field name="comment">Teaching staff: their own batches only, enforced by record rules in the modules that need it (attendance, exam).</field>
</record>
<record id="group_accountant" model="res.groups">
<field name="name">Accountant</field>
<field name="privilege_id" ref="privilege_school"/>
<field name="implied_ids" eval="[(4, ref('group_school_staff'))]"/>
<field name="comment">Fees, invoices and payments.</field>
</record>
<record id="group_school_administrator" model="res.groups">
<field name="name">School Administrator</field>
<field name="privilege_id" ref="privilege_school"/>
<field name="implied_ids" eval="[(4, ref('group_school_staff'))]"/>
<field name="comment">Full read/write on the academic structure: years, terms, programs, batches.</field>
<!-- Same convention core Odoo modules use (see hr.group_hr_manager):
the database's own Administrator account should not need a
manual group assignment just to see this module's menus after
install. -->
<field name="user_ids" eval="[(4, ref('base.user_admin'))]"/>
</record>
<!-- Portal roles -->
<record id="group_guardian" model="res.groups">
<field name="name">Guardian</field>
<field name="privilege_id" ref="privilege_school"/>
<field name="implied_ids" eval="[(4, ref('base.group_portal'))]"/>
<field name="comment">Portal access is scoped by mc.student.guardian links, never by holding this group alone. See CLAUDE.md sec 3.</field>
</record>
<record id="group_student" model="res.groups">
<field name="name">Student</field>
<field name="privilege_id" ref="privilege_school"/>
<field name="implied_ids" eval="[(4, ref('base.group_portal'))]"/>
<field name="comment">Portal access to the student's own record only, enforced by record rules.</field>
</record>
</odoo>