Commit graph

39 commits

Author SHA1 Message Date
Denis Durepos
85a2a3fafe feat: refactor portal player detail view with comprehensive tabs and status card
- Add comprehensive tabbed player detail view with full parity to internal view
- Implement four organized tabs: Injuries, Patient Info, Team Info, Emergency Contacts
- Add prominent status card above tabs showing match/practice status and allergies
- Add email field to emergency contacts model and forms
- Fix QWeb template errors by replacing t-field date widgets with t-esc in td elements
- Convert HTML fields to Text fields to resolve tracking compatibility issues
- Maintain role-based access control throughout all tabs
- Add missing fields: injured_since, active_injury_count for complete parity
- Improve UI/UX with color-coded status badges and responsive design
2025-07-23 21:01:01 -04:00
Denis Durepos
a8aa7e71c2 fix: resolve portal emergency contact field reference errors and ACL issues
- Fix KeyError: 'relationship' by updating all controller methods to use 'contact_type' field
- Fix AttributeError: 'phone' by changing template references to use 'mobile' field
- Remove references to non-existent fields (email, notes) from emergency contact forms
- Fix XML syntax errors in emergency contact templates
- Grant create/write permissions to portal treatment professionals on res.partner model
- Update patient notes button URL from /my/patient/notes to /my/injury/notes
- Fix emergency contact form validation and field assignments in controllers
- Ensure all field references match actual sports.patient.contact model schema

Resolves portal 500 errors when viewing player details and managing emergency contacts.
Therapists can now successfully add/edit emergency contacts without field reference errors.
2025-07-23 18:45:35 -04:00
Denis Durepos
6cfb9551b0 feat: Implement comprehensive ACL and RPC security fixes
- Fix ACL test assumptions about browse() behavior
  * Update tests to check field-level access instead of browse().exists()
  * Correct test methodology for AccessError validation

- Implement buddy method pattern for RPC security
  * Refactor all sudo()/api.model methods to use public/private pattern
  * Public methods perform access checks, private methods contain privileged ops
  * Prevents RPC privilege escalation vulnerabilities

- Enhanced security architecture
  * Add comprehensive mail activity portal access rules
  * Strengthen partner access controls
  * Update controller method references to use secure public methods

- Test suite improvements
  * Add extensive mail activity portal access tests
  * Update player removal tests to use public method interfaces
  * Improve test coverage for security scenarios

- Security best practices enforcement
  * All privileged operations now encapsulated in private methods
  * Clear separation between public API and internal operations
  * Maintains functionality while securing RPC access

Resolves RPC security vulnerabilities and establishes proper ACL enforcement patterns.
2025-07-22 21:07:51 -04:00
Denis Durepos
c0834eb327 [REF] bemade_sports_clinic: Remove injury models and simplify data model
- Removed models/injury_models.py and all its references
- Converted relational fields to character fields:
  - body_location_id → body_location
  - injury_type_id → injury_type
- Updated portal templates to use text inputs instead of dropdowns
- Updated controller code to process the new field formats
- Removed related access rights from security CSV
- Modified test files to accommodate the new structure

This refactoring simplifies the data model by removing unnecessary
classifications that were adding complexity without significant benefit.
The direct text fields maintain the same functionality while reducing
the database overhead and simplifying the UI.
2025-07-16 11:37:50 -04:00
Denis Durepos
8c9d60c550 [FIX] bemade_sports_clinic: Fix treatment note views for Odoo 18 compatibility
- Change view type from 'tree' to 'list' for Odoo 18 compatibility
- Update XML structure to use <list> instead of <tree> tags
- Fix parent menu reference to use existing sports_clinic_root menu
2025-07-12 12:39:29 -04:00
Denis Durepos
ca57ec8f16 [IMP] bemade_sports_clinic: Refactor portal views and enhance treatment notes
- Refactor portal templates to eliminate intra-module template inheritance
- Integrate emergency contacts section into player injuries template
- Add full internal admin views for treatment notes with chatter support
- Fix ORM warning in test_rights by using proper ORM commands
- Update manifest to reflect new functionality (v18.0.1.9.0)

This refactoring improves template stability by removing XPath errors and
provides treatment professionals with better access to emergency contacts
and treatment notes both in portal and backend interfaces.
2025-07-11 21:47:50 -04:00
Denis Durepos
1f91c27a44 Added Add Player functionality to portal access for therapists and coaches. 2025-06-22 11:32:53 -04:00
Denis Durepos
c60ffd5bfa Created portal views for therapists and Report Injury functionality for portal users (coaches and therapists). 2025-06-21 21:24:50 -04:00
Denis Durepos
b4eea01a20 Migrated bemade_sports_clinic to 18.0 2025-06-20 14:56:47 -04:00
Marc Durepos
4b2b53caa7 Revert "Clean up repository for apps.odoo.com sharing: Remove non-18.0 addons and document them in README.md"
Addons were butchered by this commit.

This reverts commit b33f25c688.
2025-05-29 21:35:47 -04:00
Marc Durepos
b33f25c688 Clean up repository for apps.odoo.com sharing: Remove non-18.0 addons and document them in README.md 2025-05-06 09:04:12 -04:00
Marc Durepos
4baef176fb Merge branch '16.0' into 17.0
Forward port of latest updates.
2024-10-15 08:56:28 -04:00
Marc Durepos
75e986a4a2 bemade_sport_clinic: improve facility for deactivating team staff 2024-09-05 18:41:51 +00:00
Marc Durepos
418d03d3a9 add more tracking to sports.team 2024-06-03 19:19:55 -04:00
Marc Durepos
6912a6ef8a add more tracking to sports.team 2024-06-03 19:17:52 -04:00
Marc Durepos
17b971f410 fix issues with access rules on teams in controller and portal views 2024-04-30 11:32:49 -04:00
Marc Durepos
b0060ad56b bemade_sports_clinic: limit access rights 2024-04-17 16:43:05 -04:00
Marc Durepos
70d262d6f7 bemade_sports_clinic: update attrs in views 2024-03-21 09:30:02 -04:00
Marc Durepos
0a2ec5fd8d bemade_sports_clinic: add consent field, translations and general cleanup 2024-02-20 20:06:35 -05:00
Marc Durepos
6ff1bf5706 [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.
2023-12-11 21:30:08 -05:00
Marc Durepos
c950fe3e93 [ENH] bemade_sports_clinic: wrap text on the portal and show HTML.
Allows portal users to see the full diagnosis and notes. Previously,
diagnosis was truncated if it went beyond the bounds of the column.

Also, notes are now shown in HTML instead of HTML escaped to text.
2023-12-11 18:24:45 -05:00
Marc Durepos
814841943f Remove migrations file. Fix controller and portal view breadcrumbs. 2023-11-21 06:27:18 -05:00
Marc Durepos
032cc46666 Iteration 5 for sports clinic management.
- Team staff phone field replaced by mobile field
  - Doctor added to team staff options
  - Trainer replaced by therapist in team staff nomenclature
  - N/A option and onchange behaviour for injury date
  - Patient contact info added on the form view (linked to partner)
  - Allergies field added to patient record
  - Notes added to team information section of patient record
  - Fixed next page button on portal (controller routes update)
2023-11-19 21:07:16 -05:00
Marc Durepos
7cd32e2b93 More changes for iteration 4:
- Change phone to mobile for team staff
 - Add Doctor to roles selection for team staff
 - Replace "Trainer" by "Therapist" everywhere
2023-11-08 08:33:04 -05:00
Marc Durepos
2df2717f38 Default patient ID for creating injury from another injury's form view. 2023-11-07 14:00:56 -05:00
Marc Durepos
9bd47d8180 Fix for teams not showing up on res_user form. 2023-11-07 11:37:34 -05:00
Marc Durepos
d6c40a456e Completes iteration 4 without translations. 2023-11-06 22:26:30 -05:00
Marc Durepos
44f391802d bemade_sports_clinic: update portal view and color backend list views. 2023-11-06 20:18:11 -05:00
Marc Durepos
b19e71b0af bemade_sports_clinic iteration 3 complete. 2023-10-29 15:57:42 -04:00
Marc Durepos
1a287d1452 bemade_sports_clinic iteration 3 progress on fields and views. 2023-10-28 17:20:22 -04:00
Marc Durepos
e951c23346 Added decoration to patient tree views. 2023-10-28 07:32:15 -04:00
Marc Durepos
93a82074df bemade_sports_clinic: second iteration complete. 2023-10-22 15:37:47 -04:00
Marc Durepos
d92c124f50 bemade_sports_clinic: Lots of work on models and views for second iteration. 2023-10-21 21:32:35 -04:00
Marc Durepos
5652f9387e bemade_sports_clinic: added Players page to res_partner form view for teams. 2023-10-17 11:17:46 -04:00
Marc Durepos
825e6fd651 bemade_sports_clinic: portal prototype is functional. 2023-10-17 10:47:33 -04:00
Marc Durepos
f6f6ef1ef3 bemade_sports_clinic: Controller created along with basic homepage view to show counts for teams and patients to team staff. 2023-10-17 09:10:33 -04:00
Marc Durepos
ada948b41d bemade_sports_clinic: Got rid of the treatment professional type for res_users. 2023-10-16 16:38:47 -04:00
Marc Durepos
5113c065ab bemade_sports_clinic: added form view for injuries. Fixed record rule for injuries. 2023-10-16 16:23:18 -04:00
Marc Durepos
a37acac519 Added a bunch of stuff for bemade_sports_clinic 2023-10-16 14:29:28 -04:00