Odoo_Dance_SCL/addons/dance_attendance/views/dance_session_views.xml

132 lines
6.7 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="view_dance_session_tree" model="ir.ui.view">
<field name="name">dance.session.tree</field>
<field name="model">dance.session</field>
<field name="arch" type="xml">
<tree string="Sessions">
<field name="date"/>
<field name="batch_id"/>
<field name="start_time" widget="float_time"/>
<field name="end_time" widget="float_time"/>
<field name="room"/>
<field name="instructor_id"/>
<field name="attendance_count"/>
<field name="present_count"/>
<field name="absent_count"/>
<field name="late_count"/>
<field name="status"/>
</tree>
</field>
</record>
<record id="view_dance_session_form" model="ir.ui.view">
<field name="name">dance.session.form</field>
<field name="model">dance.session</field>
<field name="arch" type="xml">
<form string="Session">
<header>
<button name="action_load_students" type="object" string="Load Students" class="btn-primary" invisible="status == 'cancelled'"/>
<button name="action_mark_all_present" type="object" string="Mark All Present" invisible="status == 'cancelled'"/>
<button name="action_complete" type="object" string="Complete" invisible="status != 'scheduled'"/>
<button name="action_cancel" type="object" string="Cancel" invisible="status == 'cancelled'"/>
<button name="action_create_makeup_session" type="object" string="Create Makeup" invisible="status != 'cancelled'"/>
<field name="status" widget="statusbar" statusbar_visible="scheduled,completed,cancelled"/>
</header>
<sheet>
<group>
<group string="Session">
<field name="batch_id"/>
<field name="date"/>
<field name="start_time" widget="float_time"/>
<field name="end_time" widget="float_time"/>
<field name="room"/>
</group>
<group string="Instructor">
<field name="instructor_id"/>
<field name="substitute_instructor_id"/>
<field name="attendance_count" readonly="1"/>
<field name="present_count" readonly="1"/>
<field name="absent_count" readonly="1"/>
<field name="late_count" readonly="1"/>
</group>
</group>
<notebook>
<page string="Cancellation">
<group>
<field name="is_cancelled"/>
<field name="cancellation_reason" placeholder="Example: Instructor unavailable"/>
<field name="makeup_for_id"/>
<field name="makeup_session_ids" readonly="1"/>
</group>
</page>
<page string="Attendance">
<field name="attendance_ids" context="{'default_session_id': id}">
<tree editable="bottom">
<field name="student_id"/>
<field name="status"/>
<field name="remarks"/>
</tree>
</field>
</page>
<page string="Notes">
<field name="notes" nolabel="1"/>
</page>
</notebook>
</sheet>
</form>
</field>
</record>
<record id="view_dance_session_calendar" model="ir.ui.view">
<field name="name">dance.session.calendar</field>
<field name="model">dance.session</field>
<field name="arch" type="xml">
<calendar string="Sessions" date_start="date" color="batch_id" mode="month">
<field name="batch_id"/>
<field name="instructor_id"/>
<field name="status"/>
</calendar>
</field>
</record>
<record id="view_dance_session_search" model="ir.ui.view">
<field name="name">dance.session.search</field>
<field name="model">dance.session</field>
<field name="arch" type="xml">
<search string="Sessions">
<field name="batch_id"/>
<field name="instructor_id"/>
<filter name="today_sessions" string="Today"
domain="[('date', '=', context_today().strftime('%Y-%m-%d'))]"/>
<filter name="upcoming_sessions" string="Upcoming"
domain="[('date', '>=', context_today().strftime('%Y-%m-%d')), ('status', '=', 'scheduled')]"/>
<separator/>
<filter name="scheduled_sessions" string="Scheduled" domain="[('status', '=', 'scheduled')]"/>
<filter name="completed_sessions" string="Completed" domain="[('status', '=', 'completed')]"/>
<filter name="cancelled_sessions" string="Cancelled" domain="[('status', '=', 'cancelled')]"/>
<group expand="0" string="Group By">
<filter name="group_by_batch" string="Batch" context="{'group_by': 'batch_id'}"/>
<filter name="group_by_instructor" string="Instructor" context="{'group_by': 'instructor_id'}"/>
<filter name="group_by_status" string="Status" context="{'group_by': 'status'}"/>
<filter name="group_by_date" string="Date" context="{'group_by': 'date'}"/>
</group>
</search>
</field>
</record>
<record id="action_sessions_dashboard" model="ir.actions.client">
<field name="name">Sessions Dashboard</field>
<field name="tag">dance_attendance.action_sessions_dashboard</field>
</record>
<record id="action_dance_sessions" model="ir.actions.act_window">
<field name="name">Sessions</field>
<field name="res_model">dance.session</field>
<field name="view_mode">tree,form,calendar</field>
<field name="search_view_id" ref="view_dance_session_search"/>
</record>
<menuitem id="menu_dance_sessions" name="Sessions" parent="dance_student.menu_dance_root" action="action_sessions_dashboard" sequence="40"/>
</odoo>