Fix treatment professional portal access and group assignment

- Add patient address management in portal UI for therapists/coaches
- Fix treatment professional selection dropdown in injury detail forms
- Implement automatic group assignment when portal access is granted
- Add create() and write() overrides in res.users to detect portal access
- Expand treatment professional roles to include doctors
- Add comprehensive debugging for portal access workflow
- Update portal UI buttons to use Odoo company colors
- Add ACLs for snailmail.letter and res.users access for portal groups

Resolves issues with treatment professionals not appearing in portal
dropdowns after being granted portal access. Now works for all roles:
doctors, therapists, and head therapists.
This commit is contained in:
Denis Durepos 2025-07-27 20:20:23 -04:00
parent 82266644ca
commit fae0d98637
11 changed files with 272 additions and 84 deletions

View file

@ -158,5 +158,5 @@
- [ ]Change action button colors to Fit Crew color scheme (instead of the weird turquoise)
- [ ]Confirm followers added correctly when therapist adds player to team
- [x]Remove Team from injury detail (including from model - was not there before)
- [ ]Fix treatment professional selection in injury detail
- [ ]Add patient address add/edit to coach/therapist portal
- [x]Fix treatment professional selection in injury detail
- [x]Add patient address add/edit to coach/therapist portal

View file

@ -78,10 +78,17 @@ class PlayerManagementPortal(CustomerPortal):
# Debug log for the entire patient_info dictionary
_logger.info(f"DEBUG - patient_info: {patient_info}")
# Get Canada and Canadian provinces/territories for address dropdowns
canada = request.env['res.country'].search([('code', '=', 'CA')], limit=1)
states = request.env['res.country.state'].search([('country_id', '=', canada.id)], order='name') if canada else request.env['res.country.state']
countries = canada if canada else request.env['res.country'].search([], order='name')
values = {
'patient': patient, # Keep original patient
'patient_info': patient_info, # Add patient_info for protected fields
'teams': teams,
'states': states,
'countries': countries,
'return_url': return_url,
'page_name': 'edit_player',
'is_treatment_prof': is_treatment_prof,
@ -126,6 +133,27 @@ class PlayerManagementPortal(CustomerPortal):
'phone': post.get('phone'),
})
# Address information - any portal user with access can update these
address_fields = ['street', 'street2', 'city', 'zip']
for field in address_fields:
if field in post:
vals[field] = post.get(field) or False
# Handle state and country selections
if post.get('state_id'):
try:
state_id = int(post.get('state_id'))
vals['state_id'] = state_id
except (ValueError, TypeError):
pass # Invalid state_id, skip
if post.get('country_id'):
try:
country_id = int(post.get('country_id'))
vals['country_id'] = country_id
except (ValueError, TypeError):
pass # Invalid country_id, skip
# Additional fields that only treatment professionals can update
if is_treatment_prof:
if post.get('date_of_birth'):

View file

@ -1,4 +1,7 @@
from odoo import models, fields, api, _, Command
import logging
_logger = logging.getLogger(__name__)
class User(models.Model):
@ -32,3 +35,77 @@ class User(models.Model):
for team in added_teams
]
)
def write(self, vals):
"""Override write to trigger treatment professional group assignment when portal access is granted."""
_logger.info(f"DEBUG: res.users.write() called with vals: {vals}")
_logger.info(f"DEBUG: Processing {len(self)} users: {[u.login for u in self]}")
# Check if groups_id is being modified (portal access being granted/revoked)
if 'groups_id' in vals:
_logger.info(f"DEBUG: groups_id is being modified: {vals['groups_id']}")
# Get the portal group reference
portal_group = self.env.ref('base.group_portal')
_logger.info(f"DEBUG: Portal group ID: {portal_group.id}")
# Store old group memberships before making changes
old_groups_by_user = {user.id: user.groups_id.ids for user in self}
_logger.info(f"DEBUG: Old groups by user: {old_groups_by_user}")
# Apply the changes first
result = super().write(vals)
# Check each user to see if portal access was granted
for user in self:
old_groups = old_groups_by_user[user.id]
new_groups = user.groups_id.ids
_logger.info(f"DEBUG: User {user.login} - Old groups: {old_groups}, New groups: {new_groups}")
if portal_group.id in new_groups and portal_group.id not in old_groups:
_logger.info(f"DEBUG: Portal access granted to {user.login} - triggering group assignment")
# Portal access was just granted - trigger treatment professional group assignment
staff_records = self.env['sports.team.staff'].search([
('partner_id', '=', user.partner_id.id)
])
_logger.info(f"DEBUG: Found {len(staff_records)} staff records for user {user.login}")
if staff_records:
_logger.info(f"DEBUG: Staff roles: {[(s.team_id.name, s.role) for s in staff_records]}")
staff_records._update_treatment_professional_group(user)
_logger.info(f"DEBUG: Group assignment completed for {user.login}")
return result
else:
_logger.info(f"DEBUG: groups_id not in vals, using normal write")
# If groups_id is not being modified, use normal write
return super().write(vals)
@api.model_create_multi
def create(self, vals_list):
"""Override create to trigger treatment professional group assignment when portal users are created."""
_logger.info(f"DEBUG: res.users.create() called with vals_list: {vals_list}")
# Create the users first
users = super().create(vals_list)
# Get the portal group reference
portal_group = self.env.ref('base.group_portal')
_logger.info(f"DEBUG: Portal group ID: {portal_group.id}")
# Check each created user to see if they were created with portal access
for user in users:
_logger.info(f"DEBUG: Created user {user.login} with groups: {user.groups_id.ids}")
if portal_group.id in user.groups_id.ids:
_logger.info(f"DEBUG: User {user.login} created with portal access - triggering group assignment")
# User was created with portal access - trigger treatment professional group assignment
staff_records = self.env['sports.team.staff'].search([
('partner_id', '=', user.partner_id.id)
])
_logger.info(f"DEBUG: Found {len(staff_records)} staff records for user {user.login}")
if staff_records:
_logger.info(f"DEBUG: Staff roles: {[(s.team_id.name, s.role) for s in staff_records]}")
staff_records._update_treatment_professional_group(user)
_logger.info(f"DEBUG: Group assignment completed for {user.login}")
return users

View file

@ -371,9 +371,19 @@ class TeamStaff(models.Model):
"""
return self.env['sports.team.staff'].sudo().search([
('partner_id', '=', partner_id),
('role', 'in', ['head_therapist', 'therapist'])
('role', 'in', ['head_therapist', 'therapist', 'doctor'])
])
def update_all_treatment_professional_groups(self):
"""Manual method to update treatment professional group assignments for all staff.
This can be called to refresh group assignments after role changes or system updates.
Useful for fixing cases where staff members were added but not assigned to correct groups.
"""
all_staff = self.env['sports.team.staff'].search([])
all_staff._update_treatment_professional_group()
return True
def _update_treatment_professional_group(self, specific_user=None):
"""Update treatment professional status based on staff role.

View file

@ -42,8 +42,11 @@ access_mail_notification_portal_tp,Portal TP Access for Mail Notifications,mail.
access_ir_attachment_portal_tp,Portal TP Access for Attachments,base.model_ir_attachment,bemade_sports_clinic.group_portal_treatment_professional,1,1,1,0
access_res_users_portal_tp,Portal TP Access for Users,base.model_res_users,bemade_sports_clinic.group_portal_treatment_professional,1,0,0,0
access_res_users_portal_coach,Portal Coach Access for Users,base.model_res_users,bemade_sports_clinic.group_portal_team_coach,1,0,0,0
access_res_partner_portal_tp,Portal TP Access for Partners,base.model_res_partner,bemade_sports_clinic.group_portal_treatment_professional,1,1,1,0
access_res_partner_portal_coach,Portal Coach Access for Partners,base.model_res_partner,bemade_sports_clinic.group_portal_team_coach,1,1,1,0
access_mail_followers_portal_tp,Portal TP Access for Followers,mail.model_mail_followers,bemade_sports_clinic.group_portal_treatment_professional,1,1,1,0
access_mail_followers_portal_coach,Portal Coach Access for Followers,mail.model_mail_followers,bemade_sports_clinic.group_portal_team_coach,1,1,1,0
access_bus_bus_portal_tp,Portal TP Access for Bus Messages,bus.model_bus_bus,bemade_sports_clinic.group_portal_treatment_professional,1,1,1,0
access_snailmail_letter_portal_tp,Portal TP Access for Snailmail Letters,snailmail.model_snailmail_letter,bemade_sports_clinic.group_portal_treatment_professional,1,0,0,0
access_snailmail_letter_portal_coach,Portal Coach Access for Snailmail Letters,snailmail.model_snailmail_letter,bemade_sports_clinic.group_portal_team_coach,1,0,0,0

1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
42 access_ir_attachment_portal_tp Portal TP Access for Attachments base.model_ir_attachment bemade_sports_clinic.group_portal_treatment_professional 1 1 1 0
43 access_res_users_portal_tp Portal TP Access for Users base.model_res_users bemade_sports_clinic.group_portal_treatment_professional 1 0 0 0
44 access_res_partner_portal_tp access_res_users_portal_coach Portal TP Access for Partners Portal Coach Access for Users base.model_res_partner base.model_res_users bemade_sports_clinic.group_portal_treatment_professional bemade_sports_clinic.group_portal_team_coach 1 1 0 1 0 0
45 access_res_partner_portal_tp Portal TP Access for Partners base.model_res_partner bemade_sports_clinic.group_portal_treatment_professional 1 1 1 0
46 access_res_partner_portal_coach Portal Coach Access for Partners base.model_res_partner bemade_sports_clinic.group_portal_team_coach 1 1 1 0
47 access_mail_followers_portal_tp Portal TP Access for Followers mail.model_mail_followers bemade_sports_clinic.group_portal_treatment_professional 1 1 1 0
48 access_mail_followers_portal_coach Portal Coach Access for Followers mail.model_mail_followers bemade_sports_clinic.group_portal_team_coach 1 1 1 0
49 access_bus_bus_portal_tp Portal TP Access for Bus Messages bus.model_bus_bus bemade_sports_clinic.group_portal_treatment_professional 1 1 1 0
50 access_snailmail_letter_portal_tp Portal TP Access for Snailmail Letters snailmail.model_snailmail_letter bemade_sports_clinic.group_portal_treatment_professional 1 0 0 0
51 access_snailmail_letter_portal_coach Portal Coach Access for Snailmail Letters snailmail.model_snailmail_letter bemade_sports_clinic.group_portal_team_coach 1 0 0 0
52

View file

@ -40,10 +40,10 @@
<div class="row mb-4">
<div class="col-lg-12">
<div class="d-flex justify-content-between">
<a t-att-href="return_url" class="btn btn-secondary">
<a t-att-href="return_url" class="btn bg-o-color-2 text-white">
<i class="fa fa-times"></i> Cancel
</a>
<button type="submit" class="btn btn-primary">
<button type="submit" class="btn bg-o-color-1 text-white">
<i class="fa fa-save"></i> Save Changes
</button>
</div>
@ -209,17 +209,17 @@
<div class="row mt-4">
<div class="col-lg-12">
<div class="float-left">
<a t-att-href="return_url" class="btn btn-secondary">Cancel</a>
</div>
<div class="float-right">
<button type="submit" class="btn btn-primary">Save Changes</button>
<a t-att-href="return_url" class="btn bg-o-color-2 text-white">Cancel</a>
<!-- Submit button -->
<button type="submit" class="btn bg-o-color-1 text-white">Save Changes</button>
<!-- Additional action buttons -->
<div class="btn-group ml-2">
<a t-att-href="'/my/injury/notes?injury_id=%s' % injury.id" class="btn btn-info">
<a t-att-href="'/my/injury/notes?injury_id=%s' % injury.id" class="btn bg-o-color-2 text-white">
<i class="fa fa-clipboard-list"></i> View Treatment Notes
</a>
<a t-att-href="'/my/injury/documents?injury_id=%s' % injury.id" class="btn btn-secondary">
<a t-att-href="'/my/injury/documents?injury_id=%s' % injury.id" class="btn bg-o-color-2 text-white">
<i class="fa fa-file-medical"></i> Documents
</a>
</div>
@ -272,7 +272,7 @@
<!-- Back button only for patient context -->
<t t-if="context == 'patient'">
<a t-att-href="'/my/player?player_id=%s' % patient.id" class="btn btn-secondary">
<a t-att-href="'/my/player?player_id=%s' % patient.id" class="btn bg-o-color-2 text-white">
<i class="fa fa-arrow-left"></i> Back to Patient
</a>
</t>
@ -314,7 +314,7 @@
placeholder="Enter treatment note"></textarea>
</div>
<button type="submit" class="btn btn-primary">Add Note</button>
<button type="submit" class="btn bg-o-color-1 text-white">Add Note</button>
</form>
</div>
</div>
@ -409,8 +409,8 @@
<div class="col-lg-12">
<div class="d-flex justify-content-between align-items-center">
<h2>Injury Documents</h2>
<a t-att-href="'/my/injury/edit?injury_id=%s' % injury.id" class="btn btn-secondary">
<i class="fa fa-arrow-left"></i> Back to Injury
<a t-att-href="'/my/injury/edit?injury_id=%s' % injury.id" class="btn bg-o-color-2 text-white">
<i class="fa fa-edit"></i> Edit Injury
</a>
</div>
@ -475,7 +475,7 @@
<small class="text-muted">Maximum file size: 10MB</small>
</div>
<button type="submit" class="btn btn-primary">Upload Document</button>
<button type="submit" class="btn bg-o-color-1 text-white">Upload Document</button>
</form>
</div>
</div>
@ -520,16 +520,17 @@
<td><span t-field="doc.created_by_id"/></td>
<td><span t-field="doc.create_date" t-options='{"widget": "date"}'/></td>
<td>
<a t-att-href="'/my/injury/document/download/%s' % doc.id" class="btn btn-sm btn-primary">
<a t-att-href="'/my/injury/document/download/%s' % doc.id" class="btn btn-sm bg-o-color-1 text-white">
<i class="fa fa-download"></i> Download
</a>
<t t-if="is_treatment_prof">
<a t-att-href="'/my/injury/document/delete/%s' % doc.id"
onclick="return confirm('Are you sure you want to delete this document?')"
class="btn btn-sm btn-danger ml-1">
<form t-att-action="'/my/injury/document/delete/%s' % doc.id" method="post" style="display: inline;">
<input type="hidden" name="csrf_token" t-att-value="request.csrf_token()"/>
<button type="submit"
class="btn btn-sm btn-danger ml-1"
onclick="return confirm('Are you sure you want to delete this document?')">
<i class="fa fa-trash"></i> Delete
</a>
</t>
</button>
</form>
</td>
</tr>
</t>

View file

@ -19,10 +19,10 @@
<div class="row mb-4">
<div class="col-lg-12">
<div class="d-flex justify-content-between">
<a t-att-href="return_url" class="btn btn-secondary">
<a t-att-href="return_url" class="btn bg-o-color-2 text-white">
<i class="fa fa-times"></i> Cancel
</a>
<button type="submit" class="btn btn-primary">
<button type="submit" class="btn bg-o-color-1 text-white">
<i class="fa fa-save"></i> Save Changes
</button>
</div>
@ -63,6 +63,79 @@
</div>
</div>
<!-- Address Information -->
<div class="row mb-3">
<div class="col-12">
<h5>Address Information</h5>
</div>
</div>
<div class="row mb-3">
<div class="col-md-12">
<div class="form-group">
<label for="street">Street Address</label>
<input type="text" name="street" id="street" class="form-control"
t-att-value="patient.street"/>
</div>
</div>
</div>
<div class="row mb-3">
<div class="col-md-12">
<div class="form-group">
<label for="street2">Street Address 2</label>
<input type="text" name="street2" id="street2" class="form-control"
t-att-value="patient.street2"/>
</div>
</div>
</div>
<div class="row mb-3">
<div class="col-md-6">
<div class="form-group">
<label for="city">City</label>
<input type="text" name="city" id="city" class="form-control"
t-att-value="patient.city"/>
</div>
</div>
<div class="col-md-3">
<div class="form-group">
<label for="zip">ZIP/Postal Code</label>
<input type="text" name="zip" id="zip" class="form-control"
t-att-value="patient.zip"/>
</div>
</div>
<div class="col-md-3">
<div class="form-group">
<label for="state_id">Province/Territory</label>
<select name="state_id" id="state_id" class="form-control">
<option value="">Select Province/Territory...</option>
<t t-foreach="states" t-as="state">
<option t-att-value="state.id"
t-att-selected="'selected' if patient.state_id and patient.state_id.id == state.id else None"
t-esc="state.name"/>
</t>
</select>
</div>
</div>
</div>
<div class="row mb-3">
<div class="col-md-6">
<div class="form-group">
<label for="country_id">Country</label>
<select name="country_id" id="country_id" class="form-control">
<t t-if="countries">
<option t-att-value="countries.id" selected="selected" t-esc="countries.name"/>
</t>
<t t-else="">
<option value="">No country available</option>
</t>
</select>
</div>
</div>
</div>
<!-- Additional fields accessible only to treatment professionals -->
<t t-if="is_treatment_prof">
<div class="row mb-3">
@ -140,10 +213,10 @@
<div class="row mt-4">
<div class="col-6">
<a t-att-href="return_url" class="btn btn-secondary">Cancel</a>
<a t-att-href="return_url" class="btn bg-o-color-2 text-white">Cancel</a>
</div>
<div class="col-6 text-right">
<button type="submit" class="btn btn-primary">Save Changes</button>
<button type="submit" class="btn bg-o-color-1 text-white">Save Changes</button>
</div>
</div>
</form>
@ -216,10 +289,10 @@
<div class="row mt-4">
<div class="col-6">
<a t-att-href="return_url" class="btn btn-secondary">Cancel</a>
<a t-att-href="return_url" class="btn bg-o-color-2 text-white">Cancel</a>
</div>
<div class="col-6 text-right">
<button type="submit" class="btn btn-primary">Add Contact</button>
<button type="submit" class="btn bg-o-color-1 text-white">Add Contact</button>
</div>
</div>
</form>
@ -249,10 +322,10 @@
<div class="row mb-4">
<div class="col-lg-12">
<div class="d-flex justify-content-between">
<a t-att-href="return_url" class="btn btn-secondary">
<a t-att-href="return_url" class="btn bg-o-color-2 text-white">
<i class="fa fa-times"></i> Cancel
</a>
<button type="submit" class="btn btn-primary">
<button type="submit" class="btn bg-o-color-1 text-white">
<i class="fa fa-save"></i> Save Changes
</button>
</div>
@ -306,10 +379,10 @@
<div class="row mt-4">
<div class="col-6">
<a t-att-href="return_url" class="btn btn-secondary">Cancel</a>
<a t-att-href="return_url" class="btn bg-o-color-2 text-white">Cancel</a>
</div>
<div class="col-6 text-right">
<button type="submit" class="btn btn-primary">Save Changes</button>
<button type="submit" class="btn bg-o-color-1 text-white">Save Changes</button>
</div>
</div>
</form>

View file

@ -89,22 +89,18 @@
<div class="row mt-4">
<div class="col-12">
<div class="btn-group" role="group">
<a href="/my/activities" class="btn btn-secondary">
<i class="fa fa-arrow-left mr-1"/>
Back to Activities
<a href="/my/activities" class="btn bg-o-color-2 text-white">
<i class="fa fa-arrow-left"></i> Back to Activities
</a>
<t t-if="activity.user_id == request.env.user">
<button type="button" class="btn btn-success" data-toggle="modal" data-target="#completeModal">
<i class="fa fa-check mr-1"/>
Complete
<button type="button" class="btn bg-o-color-1 text-white" data-toggle="modal" data-target="#completeModal">
<i class="fa fa-check"></i> Complete
</button>
<button type="button" class="btn btn-warning" data-toggle="modal" data-target="#rescheduleModal">
<i class="fa fa-calendar mr-1"/>
Reschedule
<button type="button" class="btn bg-o-color-2 text-white" data-toggle="modal" data-target="#rescheduleModal">
<i class="fa fa-calendar"></i> Reschedule
</button>
<button type="button" class="btn btn-danger" data-toggle="modal" data-target="#cancelModal">
<i class="fa fa-times mr-1"/>
Cancel
<i class="fa fa-times"></i> Cancel
</button>
</t>
</div>
@ -137,8 +133,8 @@
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
<button type="submit" class="btn btn-success">Complete Activity</button>
<button type="button" class="btn bg-o-color-2 text-white" data-dismiss="modal">Cancel</button>
<button type="submit" class="btn bg-o-color-1 text-white">Complete Activity</button>
</div>
</form>
</div>
@ -166,8 +162,8 @@
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
<button type="submit" class="btn btn-warning">Reschedule</button>
<button type="button" class="btn bg-o-color-2 text-white" data-dismiss="modal">Cancel</button>
<button type="submit" class="btn bg-o-color-1 text-white">Reschedule Activity</button>
</div>
</form>
</div>
@ -191,7 +187,7 @@
<p>Are you sure you want to cancel this activity? This action cannot be undone.</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">No, Keep It</button>
<button type="button" class="btn bg-o-color-2 text-white" data-dismiss="modal">No</button>
<button type="submit" class="btn btn-danger">Yes, Cancel Activity</button>
</div>
</form>

View file

@ -91,7 +91,7 @@
</span>
</t>
</h1>
<a t-attf-href="/my/team/{{ team.id }}/add_player" class="btn btn-primary">
<a t-attf-href="/my/team/{{ team.id }}/add_player" class="btn bg-o-color-1 text-white">
<i class="fa fa-plus me-1"/> Add Player
</a>
</div>
@ -151,7 +151,7 @@
<td class="text-center">
<div class="btn-group" role="group">
<a t-attf-href="/my/patient/injury/new?patient_id={{ player.id }}&amp;team_id={{ team.id }}"
class="btn btn-primary btn-sm"
class="btn bg-o-color-1 text-white btn-sm"
t-att-disabled="player.pending_removal">
<i class="fa fa-plus"/> Injury
</a>
@ -180,7 +180,7 @@
<!-- For team staff (coaches) - request removal -->
<t t-elif="is_team_staff">
<button type="button"
class="btn btn-warning btn-sm"
class="btn bg-o-color-2 text-white btn-sm"
data-bs-toggle="modal"
t-att-data-bs-target="'#requestRemovalModal' + str(player.id)"
t-att-class="'btn-warning' if not player.pending_removal else 'btn-secondary'"
@ -211,8 +211,8 @@
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Cancel</button>
<button type="submit" class="btn btn-warning">
<button type="button" class="btn bg-o-color-2 text-white" data-bs-dismiss="modal">Cancel</button>
<button type="submit" class="btn bg-o-color-2 text-white">
<i class="fa fa-paper-plane"/> Submit Request
</button>
</div>
@ -293,16 +293,16 @@
<div class="d-flex align-items-center mb-3">
<h1 class="mb-0"><span t-field="player.name"/></h1>
<div class="ms-auto">
<a t-att-href="'/my/player/edit?patient_id=%s' % player.id" class="btn btn-primary me-2">
<a t-att-href="'/my/player/edit?patient_id=%s' % player.id" class="btn bg-o-color-1 text-white me-2">
<i class="fa fa-edit"></i> Edit Player
</a>
<a t-att-href="'/my/patient/injury/new?patient_id=%s' % player.id" class="btn btn-primary me-2">
<a t-att-href="'/my/patient/injury/new?patient_id=%s' % player.id" class="btn bg-o-color-1 text-white me-2">
<i class="fa fa-plus"></i> Report Injury
</a>
<a t-if="is_treatment_prof" t-att-href="'/my/activity/create?model=sports.patient&amp;res_id=%s' % player.id" class="btn btn-info me-2">
<a t-if="is_treatment_prof" t-att-href="'/my/activity/create?model=sports.patient&amp;res_id=%s' % player.id" class="btn bg-o-color-2 text-white me-2">
<i class="fa fa-tasks"></i> Add Activity
</a>
<a t-if="is_treatment_prof" t-att-href="'/my/injury/notes?patient_id=%s' % player.id" class="btn btn-info">
<a t-if="is_treatment_prof" t-att-href="'/my/injury/notes?patient_id=%s' % player.id" class="btn bg-o-color-2 text-white">
<i class="fa fa-clipboard-list"></i> View Notes
<span class="badge badge-pill badge-primary ms-1" t-if="player.treatment_note_count">
<t t-esc="player.treatment_note_count"/>
@ -455,13 +455,13 @@
<t t-if="is_treatment_prof">
<td class="text-end">
<div class="btn-group">
<a t-att-href="'/my/injury/edit?injury_id=%s' % injury.id" class="btn btn-sm btn-primary">
<a t-att-href="'/my/injury/edit?injury_id=%s' % injury.id" class="btn btn-sm bg-o-color-1 text-white">
<i class="fa fa-edit"></i> Edit
</a>
<a t-att-href="'/my/injury/notes?injury_id=%s' % injury.id" class="btn btn-sm btn-info">
<a t-att-href="'/my/injury/notes?injury_id=%s' % injury.id" class="btn btn-sm bg-o-color-2 text-white">
<i class="fa fa-clipboard-list"></i> Notes
</a>
<a t-att-href="'/my/injury/documents?injury_id=%s' % injury.id" class="btn btn-sm btn-secondary">
<a t-att-href="'/my/injury/documents?injury_id=%s' % injury.id" class="btn btn-sm bg-o-color-2 text-white">
<i class="fa fa-file-medical"></i> Docs
</a>
</div>
@ -475,7 +475,7 @@
<div t-else="" class="text-center text-muted py-4">
<i class="fa fa-ambulance fa-3x mb-3"></i>
<p>No injuries recorded</p>
<a t-att-href="'/my/patient/injury/new?patient_id=%s' % player.id" class="btn btn-primary">
<a t-att-href="'/my/patient/injury/new?patient_id=%s' % player.id" class="btn bg-o-color-1 text-white">
<i class="fa fa-plus"></i> Report First Injury
</a>
</div>
@ -681,7 +681,7 @@
<div class="tab-pane fade" id="contacts" role="tabpanel" aria-labelledby="contacts-tab" t-if="is_treatment_prof">
<div class="d-flex justify-content-between align-items-center mb-3">
<h5 class="mb-0">Emergency Contacts</h5>
<a t-att-href="'/my/player/contact/add?patient_id=%s' % player.id" class="btn btn-primary">
<a t-att-href="'/my/player/contact/add?patient_id=%s' % player.id" class="btn bg-o-color-1 text-white">
<i class="fa fa-plus"></i> Add Emergency Contact
</a>
</div>
@ -706,7 +706,7 @@
</div>
<div class="btn-group mt-2">
<a t-att-href="'/my/player/contact/edit?contact_id=%s' % contact.id" class="btn btn-sm btn-primary">
<a t-att-href="'/my/player/contact/edit?contact_id=%s' % contact.id" class="btn btn-sm bg-o-color-1 text-white">
<i class="fa fa-edit"></i> Edit
</a>
<form t-att-action="'/my/player/contact/delete'" method="post" class="d-inline">
@ -727,7 +727,7 @@
<div t-else="" class="text-center text-muted py-4">
<i class="fa fa-phone fa-3x mb-3"></i>
<p>No emergency contacts found</p>
<a t-att-href="'/my/player/contact/add?patient_id=%s' % player.id" class="btn btn-primary">
<a t-att-href="'/my/player/contact/add?patient_id=%s' % player.id" class="btn bg-o-color-1 text-white">
<i class="fa fa-plus"></i> Add First Contact
</a>
</div>
@ -826,10 +826,10 @@
</div>
<div class="d-flex justify-content-between">
<a t-attf-href="/my/team?team_id={{ team.id }}" class="btn btn-secondary">
<a t-attf-href="/my/team?team_id={{ team.id }}" class="btn bg-o-color-2 text-white">
<i class="fa fa-times me-1"/> Cancel
</a>
<button type="submit" class="btn btn-primary">
<button type="submit" class="btn bg-o-color-1 text-white">
<i class="fa fa-save me-1"/> Save Player
</button>
</div>

View file

@ -50,8 +50,8 @@
</div>
</div>
<div class="clearfix mb-3">
<button type="submit" class="btn btn-primary float-right">Submit</button>
<a t-if="return_url" t-att-href="return_url" class="btn btn-secondary float-left">Cancel</a>
<button type="submit" class="btn bg-o-color-1 text-white float-right">Submit</button>
<a t-if="return_url" t-att-href="return_url" class="btn bg-o-color-2 text-white float-left">Cancel</a>
</div>
</form>
</div>
@ -71,7 +71,7 @@
<p>The injury has been reported successfully.</p>
</div>
<div class="mt-3">
<a t-att-href="return_url" class="btn btn-primary">Return</a>
<a t-att-href="return_url" class="btn bg-o-color-1 text-white">Return</a>
</div>
</div>
</t>

View file

@ -120,12 +120,12 @@
</td>
<td>
<!-- Mark as done button -->
<button class="btn btn-sm btn-success mb-1" data-toggle="modal" t-attf-data-target="#completeActivityModal_#{activity.id}">
<button class="btn btn-sm bg-o-color-1 text-white mb-1" data-toggle="modal" t-attf-data-target="#completeActivityModal_#{activity.id}">
<i class="fa fa-check"></i> Done
</button>
<!-- Reschedule button -->
<button class="btn btn-sm btn-warning mb-1" data-toggle="modal" t-attf-data-target="#rescheduleActivityModal_#{activity.id}">
<button class="btn btn-sm bg-o-color-2 text-white mb-1" data-toggle="modal" t-attf-data-target="#rescheduleActivityModal_#{activity.id}">
<i class="fa fa-calendar"></i> Reschedule
</button>
@ -156,8 +156,8 @@
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
<button type="submit" class="btn btn-primary">Complete Activity</button>
<button type="button" class="btn bg-o-color-2 text-white" data-dismiss="modal">Cancel</button>
<button type="submit" class="btn bg-o-color-1 text-white">Complete Activity</button>
</div>
</form>
</div>
@ -187,8 +187,8 @@
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
<button type="submit" class="btn btn-primary">Reschedule</button>
<button type="button" class="btn bg-o-color-2 text-white" data-dismiss="modal">Cancel</button>
<button type="submit" class="btn bg-o-color-1 text-white">Reschedule</button>
</div>
</form>
</div>
@ -213,7 +213,7 @@
<p>Are you sure you want to cancel this activity? This action cannot be undone.</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">No</button>
<button type="button" class="btn bg-o-color-2 text-white" data-dismiss="modal">No</button>
<button type="submit" class="btn btn-danger">Yes, Cancel Activity</button>
</div>
</form>
@ -306,10 +306,10 @@
<div class="row mt-4">
<div class="col-6">
<a t-att-href="return_url" class="btn btn-secondary">Cancel</a>
<a t-att-href="return_url" class="btn bg-o-color-2 text-white">Cancel</a>
</div>
<div class="col-6 text-right">
<button type="submit" class="btn btn-primary">Create Activity</button>
<button type="submit" class="btn bg-o-color-1 text-white">Create Activity</button>
</div>
</div>
</form>
@ -345,10 +345,10 @@
<div class="row mb-4">
<div class="col-lg-12">
<div class="d-flex justify-content-between">
<a href="/my/activities" class="btn btn-secondary">
<i class="fa fa-times"></i> Cancel
<a href="/my/activities" class="btn bg-o-color-2 text-white">
<i class="fa fa-arrow-left"></i> Back to Activities
</a>
<button type="submit" class="btn btn-primary">
<button type="submit" class="btn bg-o-color-1 text-white">
<i class="fa fa-save"></i> Save Changes
</button>
</div>
@ -416,10 +416,10 @@
<div class="row mt-4">
<div class="col-6">
<a href="/my/activities" class="btn btn-secondary">Cancel</a>
<a href="/my/activities" class="btn bg-o-color-2 text-white">Cancel</a>
</div>
<div class="col-6 text-right">
<button type="submit" class="btn btn-primary">Update Activity</button>
<button type="submit" class="btn bg-o-color-1 text-white">Update Activity</button>
</div>
</div>
</form>