[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.
This commit is contained in:
Marc Durepos 2023-12-11 21:30:08 -05:00
parent c950fe3e93
commit 6ff1bf5706
3 changed files with 45 additions and 2 deletions

View file

@ -18,7 +18,7 @@
#
{
'name': 'Sports Clinic Management',
'version': '16.0.1.5.1',
'version': '16.0.1.5.2',
'summary': 'Manage the patients of a sports medicine clinic.',
'description': """
Adds the notion of sports teams, players (patients), coaches and treatment

View file

@ -61,7 +61,7 @@ class Patient(models.Model):
"return to match play.")
is_injured = fields.Boolean(compute="_compute_is_injured")
stage = fields.Selection(
selection=[('no_play', 'Injured'), ('practice_ok', 'Cleared for Practice'), ('healthy', 'Cleared to Play')],
selection=[('no_play', 'Injured'), ('practice_ok', 'Practice OK'), ('healthy', 'Play OK')],
compute='_compute_stage')
last_consultation_date = fields.Date()
active_injury_count = fields.Integer(compute='_compute_active_injury_count')

View file

@ -62,6 +62,49 @@
</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>