metatroncubeswdev e5aba291f1 O4: mc_education_attendance - mobile-first bulk marking, own batches only
Serves Demo Scene 4: mc.attendance (student x date x session, unique
constraint so resubmission can never duplicate) plus a bulk-marking
wizard - pick a batch/date/session, the roster loads pre-filled
Present (or whatever was already recorded, if reopening), tap to
change an exception, Submit. Submitting again for the same
batch/date/session updates the same rows rather than creating
duplicates - verified with a real test that marks a batch present,
then reopens and corrects one student, then asserts there are still
exactly two rows, not three.

The "teachers may only mark their own batches" rule is a record rule
(ir.rule scoped to group_teacher via batch_id.class_teacher_id.
user_id), not a UI check, per CLAUDE.md sec 3 and the O4 spec line
verbatim. Verified for real, not just declared: a teacher user who
is not the class teacher of a batch gets AccessError on create *and*
on reading an existing attendance row by id directly (the actual
"cannot open another teacher's batch by editing the URL" scenario),
while Administrator remains unrestricted since the rule's `groups`
field scopes it to teacher only.

Caught two Odoo 19 search-view schema changes while installing
against a live odoo:19.0 container - a plain read of the view XML
wouldn't have caught these, only trying to actually load it did:
neither the group-by `<group>` element nor the filter groups inside
a `<search>` view accept a `string` or `expand` attribute anymore
(confirmed against hr's own search views, which use bare `<group>`).

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

105 lines
5.6 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!-- History through the start of this month, leaving today unmarked
so Demo Scene 4 (a teacher taking attendance live) has something
real to do, and Scene 1's dashboard / Scene 5's month view have
a real pattern to show instead of an empty state. -->
<record id="demo_attendance_aditya_09_01" model="mc.attendance">
<field name="student_id" ref="mc_education_base.demo_student_aditya_krishnan"/>
<field name="batch_id" ref="mc_education_base.demo_batch_grade8_a"/>
<field name="date">2026-09-01</field>
<field name="state">present</field>
</record>
<record id="demo_attendance_aditya_09_02" model="mc.attendance">
<field name="student_id" ref="mc_education_base.demo_student_aditya_krishnan"/>
<field name="batch_id" ref="mc_education_base.demo_batch_grade8_a"/>
<field name="date">2026-09-02</field>
<field name="state">present</field>
</record>
<record id="demo_attendance_aditya_09_03" model="mc.attendance">
<field name="student_id" ref="mc_education_base.demo_student_aditya_krishnan"/>
<field name="batch_id" ref="mc_education_base.demo_batch_grade8_a"/>
<field name="date">2026-09-03</field>
<field name="state">absent</field>
</record>
<record id="demo_attendance_aditya_09_04" model="mc.attendance">
<field name="student_id" ref="mc_education_base.demo_student_aditya_krishnan"/>
<field name="batch_id" ref="mc_education_base.demo_batch_grade8_a"/>
<field name="date">2026-09-04</field>
<field name="state">present</field>
</record>
<record id="demo_attendance_aditya_09_07" model="mc.attendance">
<field name="student_id" ref="mc_education_base.demo_student_aditya_krishnan"/>
<field name="batch_id" ref="mc_education_base.demo_batch_grade8_a"/>
<field name="date">2026-09-07</field>
<field name="state">late</field>
</record>
<record id="demo_attendance_aditya_09_08" model="mc.attendance">
<field name="student_id" ref="mc_education_base.demo_student_aditya_krishnan"/>
<field name="batch_id" ref="mc_education_base.demo_batch_grade8_a"/>
<field name="date">2026-09-08</field>
<field name="state">present</field>
</record>
<record id="demo_attendance_aditya_09_09" model="mc.attendance">
<field name="student_id" ref="mc_education_base.demo_student_aditya_krishnan"/>
<field name="batch_id" ref="mc_education_base.demo_batch_grade8_a"/>
<field name="date">2026-09-09</field>
<field name="state">present</field>
</record>
<record id="demo_attendance_aditya_09_10" model="mc.attendance">
<field name="student_id" ref="mc_education_base.demo_student_aditya_krishnan"/>
<field name="batch_id" ref="mc_education_base.demo_batch_grade8_a"/>
<field name="date">2026-09-10</field>
<field name="state">present</field>
</record>
<record id="demo_attendance_ananya_09_01" model="mc.attendance">
<field name="student_id" ref="mc_education_base.demo_student_ananya_krishnan"/>
<field name="batch_id" ref="mc_education_base.demo_batch_grade5_b"/>
<field name="date">2026-09-01</field>
<field name="state">present</field>
</record>
<record id="demo_attendance_ananya_09_02" model="mc.attendance">
<field name="student_id" ref="mc_education_base.demo_student_ananya_krishnan"/>
<field name="batch_id" ref="mc_education_base.demo_batch_grade5_b"/>
<field name="date">2026-09-02</field>
<field name="state">present</field>
</record>
<record id="demo_attendance_ananya_09_03" model="mc.attendance">
<field name="student_id" ref="mc_education_base.demo_student_ananya_krishnan"/>
<field name="batch_id" ref="mc_education_base.demo_batch_grade5_b"/>
<field name="date">2026-09-03</field>
<field name="state">present</field>
</record>
<record id="demo_attendance_ananya_09_04" model="mc.attendance">
<field name="student_id" ref="mc_education_base.demo_student_ananya_krishnan"/>
<field name="batch_id" ref="mc_education_base.demo_batch_grade5_b"/>
<field name="date">2026-09-04</field>
<field name="state">on_leave</field>
</record>
<record id="demo_attendance_ananya_09_07" model="mc.attendance">
<field name="student_id" ref="mc_education_base.demo_student_ananya_krishnan"/>
<field name="batch_id" ref="mc_education_base.demo_batch_grade5_b"/>
<field name="date">2026-09-07</field>
<field name="state">present</field>
</record>
<record id="demo_attendance_ananya_09_08" model="mc.attendance">
<field name="student_id" ref="mc_education_base.demo_student_ananya_krishnan"/>
<field name="batch_id" ref="mc_education_base.demo_batch_grade5_b"/>
<field name="date">2026-09-08</field>
<field name="state">present</field>
</record>
<record id="demo_attendance_ananya_09_09" model="mc.attendance">
<field name="student_id" ref="mc_education_base.demo_student_ananya_krishnan"/>
<field name="batch_id" ref="mc_education_base.demo_batch_grade5_b"/>
<field name="date">2026-09-09</field>
<field name="state">present</field>
</record>
<record id="demo_attendance_ananya_09_10" model="mc.attendance">
<field name="student_id" ref="mc_education_base.demo_student_ananya_krishnan"/>
<field name="batch_id" ref="mc_education_base.demo_batch_grade5_b"/>
<field name="date">2026-09-10</field>
<field name="state">present</field>
</record>
</odoo>