bemade-addons/bemade_sports_clinic/views/sports_team_views.xml
2024-03-21 09:30:02 -04:00

145 lines
7.1 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="teams_view_search" model="ir.ui.view">
<field name="name">teams.view.search</field>
<field name="model">sports.team</field>
<field name="arch" type="xml">
<search>
<field name="name"/>
<field name="parent_id" string="Parent Organization"/>
<field name="head_coach_id"/>
<field name="head_therapist_id"/>
<filter context="{'group_by': 'parent_id'}" name="groupby_parent_id"/>
<filter context="{'group_by': 'head_coach_id'}" name="groupby_head_coach_id"/>
<filter context="{'group_by': 'head_therapist_id'}" name="groupby_head_therapist_id"/>
</search></field>
</record>
<record id="sports_team_view_kanban" model="ir.ui.view">
<field name="name">sports.team.view.kanban</field>
<field name="model">sports.team</field>
<field name="arch" type="xml">
<kanban archivable="false" default_group_by="parent_id" default_order="name" group_create="false" group_delete="false">
<field name="name"/>
<field name="parent_id"/>
<field name="head_coach_name"/>
<field name="head_therapist_name"/>
<field name="injured_count"/>
<field name="healthy_count"/>
<templates>
<t t-name="kanban-box">
<div t-attf-class="oe_kanban_content oe_kanban_global_click">
<div>
<strong class="o_kanban_record_title">
<span>
<field name="name"/>
</span>
</strong>
</div>
<div>
<span class="o_kanban_record_subtitle">
<field name="parent_id"/>
</span>
</div>
<div>
<span>
Head coach:
<field name="head_coach_name"/>
</span>
</div>
<div>
<span>
Head therapist:
<field name="head_therapist_name"/>
</span>
</div>
<div class="o_kanban_record_bottom">
<div class="oe_kanban_bottom_left">
<span class="text-success">
Healthy:
<field name="healthy_count"/>
</span>
</div>
<div class="oe_kanban_bottom_right">
<span t-attf-class="{{record.injured_count.value != 0 ? 'text-danger' : ''}}">
Injured:
<field name="injured_count"/>
</span>
</div>
</div>
</div>
</t>
</templates>
</kanban></field>
</record>
<record id="sports_team_view_list" model="ir.ui.view">
<field name="name">sports.team.view.list</field>
<field name="model">sports.team</field>
<field name="arch" type="xml">
<tree string="Sports Teams">
<field name="name"/>
<field name="parent_id"/>
<field name="head_coach_id"/>
<field name="head_therapist_id"/>
<field name="player_count"/>
<field name="injured_count"/>
</tree></field>
</record>
<record id="sports_team_view_form" model="ir.ui.view">
<field name="name">sports.team.view.form</field>
<field name="model">sports.team</field>
<field name="arch" type="xml">
<form>
<field invisible="1" name="id"/>
<header/>
<sheet>
<div class="oe_button_box"/>
<div class="oe_title">
<h1>
<field name="name"/>
</h1>
</div>
<group string="Team Information">
<group>
<field name="parent_id"/>
<field name="player_count"/>
<field name="injured_count"/>
</group>
<group>
<field name="staff_ids"><tree>
<field name="sequence" widget="handle"/>
<field name="name"/>
<field name="role"/>
<field name="mobile" widget="phone"/>
<field invisible="1" name="has_portal_access"/>
<field invisible="1" name="partner_id"/>
<button class="oe_highlight" groups="bemade_sports_clinic.group_sports_clinic_admin,base.group_system" icon="fa-user-plus" invisible="has_portal_access == True" name="action_grant_portal_access" title="Grant Portal Access" type="object"/>
<button class="oe_highlight" groups="bemade_sports_clinic.group_sports_clinic_admin,base.group_system" icon="fa-ban" invisible="has_portal_access == False" name="action_revoke_portal_access" title="Revoke Portal Access" type="object"/>
</tree></field>
</group>
</group>
<separator string="Players"/>
<field context="{'tree_view_ref': 'bemade_sports_clinic.sports_patient_view_list_embedded'}" name="patient_ids" nolabel="1"/>
</sheet>
</form></field>
</record>
<record id="sports_team_staff_view_form" model="ir.ui.view">
<field name="name">sports.team.staff.view.form</field>
<field name="model">sports.team.staff</field>
<field name="arch" type="xml">
<form>
<sheet>
<group>
<group>
<field name="partner_id"/>
<field name="parent_id"/>
<field name="role"/>
</group>
<group>
<field name="mobile" widget="phone"/>
<field name="email" widget="email"/>
</group>
</group>
</sheet>
</form></field>
</record>
</odoo>