Metatron_Student_ERP/addons/education_attendance/views/attendance_session_views.xml
2026-09-25 18:00:58 +05:30

185 lines
10 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="view_education_attendance_session_tree" model="ir.ui.view">
<field name="name">education.attendance.session.tree</field>
<field name="model">education.attendance.session</field>
<field name="arch" type="xml">
<list string="Attendance Sessions">
<field name="name"/>
<field name="campus_id"/>
<field name="program_id"/>
<field name="academic_year_id"/>
<field name="attendance_date"/>
<field name="period"/>
<field name="faculty_id"/>
<field name="state" widget="badge" decoration-info="state == 'draft'" decoration-warning="state == 'open'" decoration-success="state == 'completed'" decoration-danger="state == 'cancelled'"/>
</list>
</field>
</record>
<record id="view_education_attendance_session_kanban" model="ir.ui.view">
<field name="name">education.attendance.session.kanban</field>
<field name="model">education.attendance.session</field>
<field name="arch" type="xml">
<kanban default_group_by="state" class="o_kanban_small_column">
<field name="name"/>
<field name="attendance_date"/>
<field name="period"/>
<field name="faculty_id"/>
<field name="state"/>
<templates>
<t t-name="card">
<div class="oe_kanban_global_click o_kanban_card">
<div class="oe_kanban_content">
<div class="o_kanban_record_title font-weight-bold">
<strong><field name="name"/></strong>
</div>
<div class="text-muted small">
Date: <field name="attendance_date"/>
</div>
<div class="text-muted small">
Period: <field name="period"/>
</div>
<div class="text-muted small">
Faculty: <field name="faculty_id"/>
</div>
</div>
</div>
</t>
</templates>
</kanban>
</field>
</record>
<record id="view_education_attendance_session_calendar" model="ir.ui.view">
<field name="name">education.attendance.session.calendar</field>
<field name="model">education.attendance.session</field>
<field name="arch" type="xml">
<calendar string="Attendance Calendar" date_start="attendance_date" color="state" mode="month">
<field name="name"/>
<field name="period"/>
<field name="faculty_id"/>
</calendar>
</field>
</record>
<record id="view_education_attendance_session_pivot" model="ir.ui.view">
<field name="name">education.attendance.session.pivot</field>
<field name="model">education.attendance.session</field>
<field name="arch" type="xml">
<pivot string="Sessions Analysis">
<field name="program_id" type="row"/>
<field name="state" type="col"/>
<field name="attendance_date" interval="month" type="row"/>
</pivot>
</field>
</record>
<record id="view_education_attendance_session_graph" model="ir.ui.view">
<field name="name">education.attendance.session.graph</field>
<field name="model">education.attendance.session</field>
<field name="arch" type="xml">
<graph string="Sessions Analysis" type="bar">
<field name="program_id"/>
<field name="state"/>
</graph>
</field>
</record>
<record id="view_education_attendance_session_form" model="ir.ui.view">
<field name="name">education.attendance.session.form</field>
<field name="model">education.attendance.session</field>
<field name="arch" type="xml">
<form string="Attendance Session">
<header>
<button name="action_open" string="Open Session" type="object" class="oe_highlight" invisible="state != 'draft'"/>
<button name="action_complete" string="Complete Session" type="object" class="oe_highlight" invisible="state != 'open'"/>
<button name="action_cancel" string="Cancel Session" type="object" invisible="state in ('cancelled')"/>
<button name="action_draft" string="Reset to Draft" type="object" invisible="state not in ('open', 'completed', 'cancelled')"/>
<field name="state" widget="statusbar" statusbar_visible="draft,open,completed"/>
</header>
<sheet>
<div class="oe_title">
<label for="name" class="oe_edit_only"/>
<h1><field name="name" placeholder="Session Title e.g. Year 1 MCA Lecture" readonly="state != 'draft'"/></h1>
</div>
<div class="alert alert-info mt-2" role="alert" invisible="state != 'open'">
<strong>Bulk Actions:</strong>
<button name="action_bulk_present" string="Present All" type="object" class="btn btn-outline-success btn-sm mx-1"/>
<button name="action_bulk_absent" string="Absent All" type="object" class="btn btn-outline-danger btn-sm mx-1"/>
<button name="action_bulk_late" string="Late All" type="object" class="btn btn-outline-warning btn-sm mx-1"/>
<button name="action_bulk_medical" string="Medical All" type="object" class="btn btn-outline-info btn-sm mx-1"/>
<button name="action_bulk_duty" string="On Duty All" type="object" class="btn btn-outline-secondary btn-sm mx-1"/>
</div>
<group>
<group string="Academic Grouping">
<field name="campus_id" readonly="state != 'draft'"/>
<field name="department_id" readonly="state != 'draft'"/>
<field name="program_id" readonly="state != 'draft'"/>
<field name="academic_level_id" readonly="state != 'draft'"/>
</group>
<group string="Schedule &amp; Faculty">
<field name="academic_year_id" readonly="state != 'draft'"/>
<field name="academic_term_id" readonly="state != 'draft'"/>
<field name="attendance_date" readonly="state != 'draft'"/>
<field name="period" readonly="state != 'draft'"/>
<field name="faculty_id" readonly="state != 'draft'"/>
<field name="company_id" groups="base.group_multi_company"/>
</group>
</group>
<notebook>
<page string="Students List" name="students_list" invisible="state == 'draft'">
<field name="line_ids" readonly="state != 'open'">
<list editable="bottom" create="false" delete="false">
<field name="student_id" readonly="1"/>
<field name="status" widget="radio" options="{'horizontal': true}"/>
<field name="remarks"/>
<field name="time_in"/>
<field name="time_out"/>
</list>
</field>
</page>
</notebook>
</sheet>
<chatter/>
</form>
</field>
</record>
<record id="view_education_attendance_session_search" model="ir.ui.view">
<field name="name">education.attendance.session.search</field>
<field name="model">education.attendance.session</field>
<field name="arch" type="xml">
<search string="Attendance Sessions">
<field name="name"/>
<field name="campus_id"/>
<field name="department_id"/>
<field name="program_id"/>
<field name="faculty_id"/>
<field name="attendance_date"/>
<filter string="Draft" name="draft" domain="[('state', '=', 'draft')]"/>
<filter string="Open (Active)" name="open" domain="[('state', '=', 'open')]"/>
<filter string="Completed" name="completed" domain="[('state', '=', 'completed')]"/>
<filter string="Cancelled" name="cancelled" domain="[('state', '=', 'cancelled')]"/>
<group>
<filter string="Campus" name="group_campus" context="{'group_by': 'campus_id'}"/>
<filter string="Department" name="group_dept" context="{'group_by': 'department_id'}"/>
<filter string="Program" name="group_program" context="{'group_by': 'program_id'}"/>
<filter string="Status" name="group_state" context="{'group_by': 'state'}"/>
<filter string="Faculty" name="group_faculty" context="{'group_by': 'faculty_id'}"/>
<filter string="Date" name="group_date" context="{'group_by': 'attendance_date'}"/>
</group>
</search>
</field>
</record>
<record id="action_education_attendance_session" model="ir.actions.act_window">
<field name="name">Attendance Sessions</field>
<field name="res_model">education.attendance.session</field>
<field name="view_mode">list,kanban,form,calendar,pivot,graph</field>
<field name="search_view_id" ref="view_education_attendance_session_search"/>
</record>
</odoo>