bemade-addons/bemade_sports_clinic/views/sports_patient_views.xml
Marc Durepos 1ca241fafb [ENH] bemade_sports_clinic: Kanban view created to enhance mobile.
Kanban view added for players to improve the experience when browsing on
mobile. Card text color synchronized with what the user expects from the
list view.
2024-01-08 09:31:39 -05:00

252 lines
13 KiB
XML

<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<data>
<record id="sports_patient_view_search" model="ir.ui.view">
<field name="name">sports.patient.view.search</field>
<field name="model">sports.patient</field>
<field name="arch" type="xml">
<search>
<field name="first_name"/>
<field name="last_name"/>
<field name="team_ids"/>
<field name="date_of_birth" widget="date"/>
<field name="email" widget="email"/>
<field name="mobile" widget="phone"/>
<field name="predicted_return_date"/>
<field name="return_date"/>
<filter name="groupby_team_ids" context="{'group_by': 'team_ids'}"/>
</search>
</field>
</record>
<record id="sports_patient_view_list" model="ir.ui.view">
<field name="name">sports.patient.view.list</field>
<field name="model">sports.patient</field>
<field name="arch" type="xml">
<tree string="Patients"
decoration-danger="stage == 'no_play'"
decoration-warning="stage == 'practice_ok'">
<field name="first_name"/>
<field name="last_name"/>
<field name="date_of_birth"/>
<field name="age"/>
<field name="team_ids" widget="many2many_tags"/>
<field name="match_status" optional="hide"/>
<field name="practice_status" optional="hide"/>
<field name="stage" optional="show"/>
<field name="predicted_return_date" widget="date"/>
<field name="return_date" widget="date"/>
<field name="activity_ids" widget="list_activity"/>
</tree>
</field>
</record>
<record id="sports_patient_view_list_embedded" model="ir.ui.view">
<field name="name">sports.patient.view.list.embedded</field>
<field name="model">sports.patient</field>
<field name="arch" type="xml">
<tree string="Patients" multi_edit="True" editable="bottom"
decoration-danger="stage == 'no_play'"
decoration-warning="stage == 'practice_ok'">
<field name="first_name"/>
<field name="last_name"/>
<field name="date_of_birth"/>
<field name="age"/>
<field name="team_ids" widget="many2many_tags"/>
<field name="match_status" optional="hide"/>
<field name="practice_status" optional="hide"/>
<field name="stage" optional="show"/>
<field name="predicted_return_date" widget="date"/>
<field name="return_date" widget="date"/>
<field name="activity_ids" widget="list_activity"/>
<button name="action_view_patient_form" type="object"
title="Details" string="Details"/>
</tree>
</field>
</record>
<record id="sports_patient_view_kanban" model="ir.ui.view">
<field name="name">sports.patient.view.kanban</field>
<field name="model">sports.patient</field>
<field name="arch" type="xml">
<kanban>
<field name="first_name"/>
<field name="last_name"/>
<field name="date_of_birth"/>
<field name="age"/>
<field name="team_ids" widget="many2many_tags"/>
<field name="match_status" optional="hide"/>
<field name="practice_status" optional="hide"/>
<field name="stage" optional="show"/>
<field name="predicted_return_date" widget="date"/>
<field name="return_date" widget="date"/>
<field name="activity_ids" widget="list_activity"/>
<templates>
<t t-name="kanban-box">
<t t-set="stage" t-value="record.stage.raw_value"/>
<div t-attf-class="oe_kanban_global_click
{{stage === 'no_play' ? 'text-danger' : stage === 'practice_ok' ? 'text-warning' : ''}}">
<div>
<div class="o_kanban_record_top mb16">
<div class="o_kanban_record_headings mt-4">
<field name="name"/>
</div>
<div class="oe_kanban_card_header_stage">
Status: <field name="stage"/>
</div>
</div>
<div class="o_kanban_record_body">
DOB: <field name="date_of_birth" widget="date"/>
<field name="team_ids" widget="many2many_tags"/>
</div>
</div>
</div>
</t>
</templates>
</kanban>
</field>
</record>
<record id="sports_patient_view_form" model="ir.ui.view">
<field name="name">sports.patient.view.form</field>
<field name="model">sports.patient</field>
<field name="arch" type="xml">
<form>
<header>
<field name="stage" widget="statusbar" />
</header>
<sheet>
<div class="oe_button_box"></div>
<div class="oe_title"><h1>Patient Record</h1></div>
<group>
<group col="3">
<separator string="Patient Information"/>
<field name="first_name" colspan="3"/>
<field name="last_name" colspan="3"/>
<field name="date_of_birth" colspan="3"/>
<field name="age" colspan="3"/>
<label for="last_consultation_date" colspan="1"/>
<span colspan="2">
<field name="last_consultation_date" widget="date" class="oe_inline"/>
<button type="object" name="action_consulted_today"
class="fa fa-refresh" title="Set to Today's Date"/>
</span>
<field name="allergies"/>
</group>
<group>
<separator string="Team Information"/>
<field name="team_ids"
widget="many2many_tags"/>
<field name="match_status"/>
<field name="practice_status"/>
<field name="predicted_return_date"/>
<field name="return_date"/>
<field name="team_info_notes"/>
</group>
<notebook>
<page string="Injuries">
<field name="injury_ids"/>
</page>
<page string="Contacts">
<group>
<group string="Patient Phone &amp; Email">
<field name="phone" widget="phone"/>
<field name="mobile" widget="phone"/>
<field name="email" widget="email"/>
</group>
<group string="Patient Address">
<field name="street"/>
<field name="street2"/>
<field name="city"/>
<field name="state_id"/>
<field name="country_id"/>
<field name="zip"/>
</group>
</group>
<group string="Other Contacts">
<field name="contact_ids">
<tree string="Patient's Contacts"
multi_edit="1" editable="bottom">
<field name="sequence" widget="handle"/>
<field name="name"/>
<field name="contact_type"/>
<field name="mobile" widget="phone"/>
</tree>
</field>
</group>
</page>
</notebook>
</group>
</sheet>
<div class="oe_chatter">
<field name="message_follower_ids" widget="mail_followers"/>
<field name="activity_ids" widget="mail_activity"/>
<field name="message_ids" widget="mail_thread"/>
</div>
</form>
</field>
</record>
<record id="sports_patient_injury_view_form" model="ir.ui.view">
<field name="name">sports.patient.injury.view.form</field>
<field name="model">sports.patient.injury</field>
<field name="arch" type="xml">
<form>
<header>
<field name="stage" widget="statusbar"/>
</header>
<sheet>
<div class="oe_title">
<h1>
Injury Details for
<field name="patient_name" class="oe_inline"/>
</h1>
</div>
<group>
<group col="2">
<field name="patient_id" invisible="1"/>
<span colspan="2">
<label for="injury_date"/>
<field name="injury_date" widget="date" class="oe_inline"/>
<field name="injury_date_na" class="oe_inline"/>
<label for="injury_date_na"/>
</span>
<field name="diagnosis"/>
<field name="predicted_resolution_date"/>
<field name="resolution_date"/>
</group>
<group>
<field name="internal_notes" widget="html"/>
<field name="external_notes" widget="html"/>
<field name="treatment_professional_ids"
widget="many2many_tags_avatar"/>
</group>
</group>
</sheet>
<div class="oe_chatter">
<field name="message_follower_ids" widget="mail_followers"/>
<field name="activity_ids" widget="mail_activity"/>
<field name="message_ids" widget="mail_thread"/>
</div>
</form>
</field>
</record>
<record id="sports_patient_injury_view_tree" model="ir.ui.view">
<field name="name">sports.patient.injury.view.tree</field>
<field name="model">sports.patient.injury</field>
<field name="arch" type="xml">
<tree string="Patient Injury History" editable="bottom"
multi_edit="True">
<field name="patient_id" invisible="1"/>
<field name="injury_date" widget="date"/>
<field name="diagnosis"/>
<field name="predicted_resolution_date" widget="date"/>
<field name="resolution_date" widget="date"/>
<field name="treatment_professional_ids"
widget="many2many_avatar_user"/>
<field name="activity_ids" widget="list_activity"/>
<button name="action_view_injury_form" type="object"
title="Details" string="Details"
context="{'default_patient_id': patient_id}"/>
</tree>
</field>
</record>
</data>
</odoo>