metatroncubeswdev 7ac5880f20 feat(community_school): core models + teacher attendance portal (Sessions 3-A, 3-B)
Session 3-A - core models: community.school.term, .level (admin-defined,
so the same module fits a Grade 1-12 school or a Beginner-Advanced
language school with no code change), .class (auto-creates a linked
slide.channel for LMS glue), .student, .enrollment, and .attendance, plus
is_teacher on res.partner. Class enrolled_count and enrollment
attendance_rate are stored/non-stored computes driven by the
enrollment/attendance one2many chains.

Session 3-B - teacher attendance + at-risk reporting: a portal page at
/school/attendance (auth='user', scoped to classes where teacher_id
matches the logged-in user's partner - works whether the teacher is an
internal or portal user) with a roster and batch save, built as a v19
Interaction (same pattern as event_qr_ticketing's check-in page). Marking
a student absent queues a configurable notice to the parent partner.
Enrollment.is_at_risk flags students below a configurable attendance
threshold (School settings page, same <app>/<block>/<setting> pattern as
community_membership), plus an admin pivot attendance report and an
At-Risk Students list.

Verified against a live Odoo 19 + Postgres 16 container: 14/14 automated
tests pass (class/slide-channel creation, enrolled_count tracking incl.
withdrawal, attendance_rate and at-risk computation, unique
enrollment+date constraint, absence email queuing), plus a full manual
live run - created a term/level/class/student/enrollment via JSON-RPC,
loaded the actual /school/attendance page as the teacher, POSTed a batch
save marking the student absent, and confirmed both the attendance record
and the queued "Absence notice" mail.mail record.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-17 21:37:56 -04:00

36 lines
1.8 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<menuitem id="menu_school_root" name="School" sequence="26"
groups="community_school.group_school_coordinator,community_school.group_school_teacher"/>
<menuitem id="menu_school_students" name="Students"
parent="menu_school_root" action="action_school_student" sequence="10"
groups="community_school.group_school_coordinator"/>
<menuitem id="menu_school_classes" name="Classes"
parent="menu_school_root" action="action_school_class" sequence="20"
groups="community_school.group_school_coordinator"/>
<menuitem id="menu_school_enrollments" name="Enrollments"
parent="menu_school_root" action="action_school_enrollment" sequence="30"
groups="community_school.group_school_coordinator"/>
<menuitem id="menu_school_at_risk" name="At-Risk Students"
parent="menu_school_root" action="action_school_enrollment_at_risk" sequence="35"
groups="community_school.group_school_coordinator"/>
<menuitem id="menu_school_attendance_report" name="Attendance Report"
parent="menu_school_root" action="action_school_attendance_report" sequence="40"
groups="community_school.group_school_coordinator"/>
<menuitem id="menu_school_configuration" name="Configuration"
parent="menu_school_root" sequence="90"
groups="community_school.group_school_coordinator"/>
<menuitem id="menu_school_terms" name="Terms"
parent="menu_school_configuration" action="action_school_term" sequence="10"/>
<menuitem id="menu_school_levels" name="Levels"
parent="menu_school_configuration" action="action_school_level" sequence="20"/>
</odoo>