bemade_sports_clinic: update attrs in views

This commit is contained in:
Marc Durepos 2024-03-21 09:30:02 -04:00
parent a25bc32d67
commit 70d262d6f7
2 changed files with 43 additions and 59 deletions

View file

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="utf-8"?>
<odoo> <odoo>
<record id="res_partner_view_form_sports_teams" model="ir.ui.view"> <record id="res_partner_view_form_sports_teams" model="ir.ui.view">
<field name="name">res.partner.view.form.sports.teams</field> <field name="name">res.partner.view.form.sports.teams</field>
@ -7,14 +7,9 @@
<field name="arch" type="xml"> <field name="arch" type="xml">
<page name="contact_addresses" position="after"> <page name="contact_addresses" position="after">
<page name="Teams"> <page name="Teams">
<field name="owned_team_ids" <field invisible="is_company == False" name="owned_team_ids" string="Teams"/>
attrs="{'invisible': [('is_company', '=', False)]}" <field invisible="is_company == True" name="teams_served_ids" string="Teams Served"/>
string="Teams"/>
<field name="teams_served_ids"
attrs="{'invisible': [('is_company', '=', True)]}"
string="Teams Served"/>
</page> </page>
</page> </page></field>
</field>
</record> </record>
</odoo> </odoo>

View file

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="utf-8"?>
<odoo> <odoo>
<record id="teams_view_search" model="ir.ui.view"> <record id="teams_view_search" model="ir.ui.view">
<field name="name">teams.view.search</field> <field name="name">teams.view.search</field>
@ -9,21 +9,16 @@
<field name="parent_id" string="Parent Organization"/> <field name="parent_id" string="Parent Organization"/>
<field name="head_coach_id"/> <field name="head_coach_id"/>
<field name="head_therapist_id"/> <field name="head_therapist_id"/>
<filter name="groupby_parent_id" <filter context="{'group_by': 'parent_id'}" name="groupby_parent_id"/>
context="{'group_by': 'parent_id'}"/> <filter context="{'group_by': 'head_coach_id'}" name="groupby_head_coach_id"/>
<filter name="groupby_head_coach_id" <filter context="{'group_by': 'head_therapist_id'}" name="groupby_head_therapist_id"/>
context="{'group_by': 'head_coach_id'}"/> </search></field>
<filter name="groupby_head_therapist_id"
context="{'group_by': 'head_therapist_id'}"/>
</search>
</field>
</record> </record>
<record id="sports_team_view_kanban" model="ir.ui.view"> <record id="sports_team_view_kanban" model="ir.ui.view">
<field name="name">sports.team.view.kanban</field> <field name="name">sports.team.view.kanban</field>
<field name="model">sports.team</field> <field name="model">sports.team</field>
<field name="arch" type="xml"> <field name="arch" type="xml">
<kanban default_group_by="parent_id" default_order="name" <kanban archivable="false" default_group_by="parent_id" default_order="name" group_create="false" group_delete="false">
group_create="false" group_delete="false" archivable="false">
<field name="name"/> <field name="name"/>
<field name="parent_id"/> <field name="parent_id"/>
<field name="head_coach_name"/> <field name="head_coach_name"/>
@ -35,7 +30,9 @@
<div t-attf-class="oe_kanban_content oe_kanban_global_click"> <div t-attf-class="oe_kanban_content oe_kanban_global_click">
<div> <div>
<strong class="o_kanban_record_title"> <strong class="o_kanban_record_title">
<span><field name="name"/></span> <span>
<field name="name"/>
</span>
</strong> </strong>
</div> </div>
<div> <div>
@ -44,16 +41,21 @@
</span> </span>
</div> </div>
<div> <div>
<span>Head coach: <field <span>
name="head_coach_name"/></span> Head coach:
<field name="head_coach_name"/>
</span>
</div> </div>
<div> <div>
<span>Head therapist: <field <span>
name="head_therapist_name"/></span> Head therapist:
<field name="head_therapist_name"/>
</span>
</div> </div>
<div class="o_kanban_record_bottom"> <div class="o_kanban_record_bottom">
<div class="oe_kanban_bottom_left"> <div class="oe_kanban_bottom_left">
<span class="text-success">Healthy: <span class="text-success">
Healthy:
<field name="healthy_count"/> <field name="healthy_count"/>
</span> </span>
</div> </div>
@ -67,8 +69,7 @@
</div> </div>
</t> </t>
</templates> </templates>
</kanban> </kanban></field>
</field>
</record> </record>
<record id="sports_team_view_list" model="ir.ui.view"> <record id="sports_team_view_list" model="ir.ui.view">
<field name="name">sports.team.view.list</field> <field name="name">sports.team.view.list</field>
@ -81,19 +82,22 @@
<field name="head_therapist_id"/> <field name="head_therapist_id"/>
<field name="player_count"/> <field name="player_count"/>
<field name="injured_count"/> <field name="injured_count"/>
</tree> </tree></field>
</field>
</record> </record>
<record id="sports_team_view_form" model="ir.ui.view"> <record id="sports_team_view_form" model="ir.ui.view">
<field name="name">sports.team.view.form</field> <field name="name">sports.team.view.form</field>
<field name="model">sports.team</field> <field name="model">sports.team</field>
<field name="arch" type="xml"> <field name="arch" type="xml">
<form> <form>
<field name="id" invisible="1"/> <field invisible="1" name="id"/>
<header></header> <header/>
<sheet> <sheet>
<div class="oe_button_box"></div> <div class="oe_button_box"/>
<div class="oe_title"><h1><field name="name"/></h1></div> <div class="oe_title">
<h1>
<field name="name"/>
</h1>
</div>
<group string="Team Information"> <group string="Team Information">
<group> <group>
<field name="parent_id"/> <field name="parent_id"/>
@ -101,36 +105,22 @@
<field name="injured_count"/> <field name="injured_count"/>
</group> </group>
<group> <group>
<field name="staff_ids"> <field name="staff_ids"><tree>
<tree>
<field name="sequence" widget="handle"/> <field name="sequence" widget="handle"/>
<field name="name"/> <field name="name"/>
<field name="role"/> <field name="role"/>
<field name="mobile" widget="phone"/> <field name="mobile" widget="phone"/>
<field name="has_portal_access" invisible="1"/> <field invisible="1" name="has_portal_access"/>
<field name="partner_id" invisible="1"/> <field invisible="1" name="partner_id"/>
<button name="action_grant_portal_access" <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"/>
type="object" icon="fa-user-plus" <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"/>
class="oe_highlight" </tree></field>
attrs="{'invisible': [('has_portal_access', '=', True)]}"
title="Grant Portal Access"
groups="bemade_sports_clinic.group_sports_clinic_admin,base.group_system"/>
<button name="action_revoke_portal_access" type="object" icon="fa-ban"
class="oe_highlight"
attrs="{'invisible': [('has_portal_access', '=', False)]}"
title="Revoke Portal Access"
groups="bemade_sports_clinic.group_sports_clinic_admin,base.group_system"/>
</tree>
</field>
</group> </group>
</group> </group>
<separator string="Players"/> <separator string="Players"/>
<field name="patient_ids" nolabel="1" <field context="{'tree_view_ref': 'bemade_sports_clinic.sports_patient_view_list_embedded'}" name="patient_ids" nolabel="1"/>
context="{'tree_view_ref': 'bemade_sports_clinic.sports_patient_view_list_embedded'}"/>
</sheet> </sheet>
</form> </form></field>
</field>
</record> </record>
<record id="sports_team_staff_view_form" model="ir.ui.view"> <record id="sports_team_staff_view_form" model="ir.ui.view">
<field name="name">sports.team.staff.view.form</field> <field name="name">sports.team.staff.view.form</field>
@ -150,7 +140,6 @@
</group> </group>
</group> </group>
</sheet> </sheet>
</form> </form></field>
</field>
</record> </record>
</odoo> </odoo>