Odoo_Dance_SCL/addons/dance_batch/views/dance_batch_views.xml

112 lines
5.3 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="view_dance_batch_tree" model="ir.ui.view">
<field name="name">dance.batch.tree</field>
<field name="model">dance.batch</field>
<field name="arch" type="xml">
<tree string="Batches">
<field name="name"/>
<field name="dance_style"/>
<field name="level"/>
<field name="instructor_id"/>
<field name="schedule_days"/>
<field name="room"/>
<field name="active_enrollment_count"/>
<field name="capacity"/>
<field name="status"/>
</tree>
</field>
</record>
<record id="view_dance_batch_form" model="ir.ui.view">
<field name="name">dance.batch.form</field>
<field name="model">dance.batch</field>
<field name="arch" type="xml">
<form string="Batch">
<sheet>
<div class="oe_button_box" name="button_box">
<button name="action_view_enrollments" type="object" class="oe_stat_button" icon="fa-users">
<field name="active_enrollment_count" widget="statinfo" string="Students"/>
</button>
</div>
<group>
<group string="Basic">
<field name="name"/>
<field name="dance_style"/>
<field name="level"/>
<field name="status"/>
</group>
<group string="Instructor">
<field name="instructor_id"/>
<field name="room"/>
</group>
</group>
<group>
<group string="Schedule">
<field name="start_date"/>
<field name="end_date"/>
<field name="schedule_days"/>
<field name="start_time" widget="float_time"/>
<field name="end_time" widget="float_time"/>
</group>
<group string="Capacity">
<field name="capacity"/>
<field name="active_enrollment_count" readonly="1"/>
<field name="available_seats" readonly="1"/>
<field name="enrollment_count" readonly="1"/>
<field name="is_almost_full" invisible="1"/>
<field name="capacity_warning" readonly="1" invisible="not capacity_warning"/>
</group>
</group>
<notebook>
<page string="Students">
<field name="enrollment_ids" context="{'default_batch_id': id}">
<tree editable="bottom">
<field name="student_id"/>
<field name="enrollment_date"/>
<field name="status"/>
</tree>
</field>
</page>
</notebook>
</sheet>
</form>
</field>
</record>
<record id="view_dance_batch_search" model="ir.ui.view">
<field name="name">dance.batch.search</field>
<field name="model">dance.batch</field>
<field name="arch" type="xml">
<search string="Batches">
<field name="name"/>
<field name="instructor_id"/>
<field name="room"/>
<filter name="active_batches" string="Active" domain="[('status', '=', 'active')]"/>
<filter name="upcoming_batches" string="Upcoming" domain="[('status', '=', 'upcoming')]"/>
<filter name="completed_batches" string="Completed" domain="[('status', '=', 'completed')]"/>
<group expand="0" string="Group By">
<filter name="group_by_style" string="Dance Style" context="{'group_by': 'dance_style'}"/>
<filter name="group_by_level" string="Level" context="{'group_by': 'level'}"/>
<filter name="group_by_instructor" string="Instructor" context="{'group_by': 'instructor_id'}"/>
<filter name="group_by_status" string="Status" context="{'group_by': 'status'}"/>
</group>
</search>
</field>
</record>
<record id="action_batches_dashboard" model="ir.actions.client">
<field name="name">Batches Dashboard</field>
<field name="tag">dance_batch.action_batches_dashboard</field>
</record>
<record id="action_dance_batches" model="ir.actions.act_window">
<field name="name">Batches</field>
<field name="res_model">dance.batch</field>
<field name="view_mode">tree,form</field>
<field name="search_view_id" ref="view_dance_batch_search"/>
</record>
<menuitem id="menu_dance_batches" name="Batches" parent="dance_student.menu_dance_root" action="action_batches_dashboard" sequence="20"/>
</odoo>