Odoo_Dance_SCL/addons/dance_event/views/dance_event_views.xml

125 lines
6.6 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="view_dance_event_tree" model="ir.ui.view">
<field name="name">dance.event.tree</field>
<field name="model">dance.event</field>
<field name="arch" type="xml">
<tree string="Events" decoration-success="state == 'done'" decoration-muted="state == 'cancelled'">
<field name="name"/>
<field name="event_type"/>
<field name="date"/>
<field name="venue"/>
<field name="participant_count"/>
<field name="performance_count"/>
<field name="rehearsal_count"/>
<field name="state"/>
</tree>
</field>
</record>
<record id="view_dance_event_form" model="ir.ui.view">
<field name="name">dance.event.form</field>
<field name="model">dance.event</field>
<field name="arch" type="xml">
<form string="Dance Event">
<header>
<button name="action_start_planning" string="Start Planning" type="object" class="btn-primary" invisible="state != 'draft'"/>
<button name="action_start_rehearsals" string="Start Rehearsals" type="object" class="btn-primary" invisible="state not in ('draft', 'planning')"/>
<button name="action_done" string="Mark Done" type="object" invisible="state not in ('planning', 'rehearsal')"/>
<button name="action_cancel" string="Cancel" type="object" invisible="state in ('done', 'cancelled')"/>
<button name="action_send_event_notification" string="Send Event Notification" type="object" class="btn-secondary"/>
<field name="state" widget="statusbar" statusbar_visible="draft,planning,rehearsal,done"/>
</header>
<sheet>
<div class="oe_button_box" name="button_box">
<button class="oe_stat_button" type="object" name="action_create_performance_lines" icon="fa-users">
<field name="participant_count" widget="statinfo" string="Students"/>
</button>
<button class="oe_stat_button" type="object" name="action_create_performance_lines" icon="fa-star">
<field name="performance_count" widget="statinfo" string="Performances"/>
</button>
</div>
<div class="oe_title">
<label for="name"/>
<h1><field name="name" placeholder="Annual Day 2026"/></h1>
</div>
<group>
<group>
<field name="event_type"/>
<field name="date"/>
<field name="venue" placeholder="Auditorium or studio"/>
</group>
<group>
<field name="batch_ids" widget="many2many_tags"/>
<field name="student_ids" widget="many2many_tags" readonly="1"/>
</group>
</group>
<notebook>
<page string="Performances">
<button name="action_create_performance_lines" string="Load Students from Batches" type="object" class="btn-secondary"/>
<field name="performance_ids" context="{'default_event_id': id}">
<tree editable="bottom">
<field name="sequence" widget="handle"/>
<field name="student_id"/>
<field name="role"/>
<field name="costume_needed"/>
<field name="costume_status"/>
</tree>
</field>
</page>
<page string="Rehearsals">
<field name="rehearsal_ids" context="{'default_event_id': id}">
<tree>
<field name="date"/>
<field name="display_time"/>
<field name="room"/>
<field name="attendance_count"/>
<field name="absent_count"/>
<field name="status"/>
</tree>
</field>
</page>
<page string="Notes">
<field name="notes" placeholder="Competition rules, stage plan, call time, props, or backstage notes."/>
</page>
</notebook>
</sheet>
</form>
</field>
</record>
<record id="view_dance_event_search" model="ir.ui.view">
<field name="name">dance.event.search</field>
<field name="model">dance.event</field>
<field name="arch" type="xml">
<search string="Events">
<field name="name"/>
<field name="venue"/>
<field name="batch_ids"/>
<filter name="draft" string="Draft" domain="[('state', '=', 'draft')]"/>
<filter name="rehearsal" string="In Rehearsal" domain="[('state', '=', 'rehearsal')]"/>
<filter name="done" string="Done" domain="[('state', '=', 'done')]"/>
<group expand="0" string="Group By">
<filter name="group_by_type" string="Type" context="{'group_by': 'event_type'}"/>
<filter name="group_by_state" string="Status" context="{'group_by': 'state'}"/>
<filter name="group_by_date" string="Date" context="{'group_by': 'date'}"/>
</group>
</search>
</field>
</record>
<record id="action_events_dashboard" model="ir.actions.client">
<field name="name">Events Dashboard</field>
<field name="tag">dance_event.action_events_dashboard</field>
</record>
<record id="action_dance_events" model="ir.actions.act_window">
<field name="name">Events &amp; Recitals</field>
<field name="res_model">dance.event</field>
<field name="view_mode">tree,form</field>
<field name="search_view_id" ref="view_dance_event_search"/>
</record>
<menuitem id="menu_dance_event_root" name="Events &amp; Recitals" parent="dance_student.menu_dance_root" action="action_events_dashboard" sequence="35"/>
</odoo>