From 17b971f410b929cba4c6fa018d4942e36ac958cc Mon Sep 17 00:00:00 2001 From: Marc Durepos Date: Tue, 30 Apr 2024 11:32:49 -0400 Subject: [PATCH] fix issues with access rules on teams in controller and portal views --- bemade_sports_clinic/__manifest__.py | 2 +- bemade_sports_clinic/controllers/team_staff_portal.py | 3 +-- bemade_sports_clinic/views/sports_clinic_portal_views.xml | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/bemade_sports_clinic/__manifest__.py b/bemade_sports_clinic/__manifest__.py index 0f7aed8..bcaa960 100644 --- a/bemade_sports_clinic/__manifest__.py +++ b/bemade_sports_clinic/__manifest__.py @@ -18,7 +18,7 @@ # { 'name': 'Sports Clinic Management', - 'version': '16.0.1.5.8', + 'version': '16.0.1.5.9', 'summary': 'Manage the patients of a sports medicine clinic.', 'description': """ Adds the notion of sports teams, players (patients), coaches and treatment diff --git a/bemade_sports_clinic/controllers/team_staff_portal.py b/bemade_sports_clinic/controllers/team_staff_portal.py index 0487317..fc3797e 100644 --- a/bemade_sports_clinic/controllers/team_staff_portal.py +++ b/bemade_sports_clinic/controllers/team_staff_portal.py @@ -16,9 +16,8 @@ class TeamStaffPortal(CustomerPortal): @classmethod def _prepare_teams_domain(cls): user = http.request.env.user - partner = http.request.env.user.partner_id return [ - ('staff_ids', 'in', partner.team_staff_rel_ids.ids), + ('staff_ids.user_ids', 'in', user.id), ] @classmethod diff --git a/bemade_sports_clinic/views/sports_clinic_portal_views.xml b/bemade_sports_clinic/views/sports_clinic_portal_views.xml index 63d0cb7..cca1435 100644 --- a/bemade_sports_clinic/views/sports_clinic_portal_views.xml +++ b/bemade_sports_clinic/views/sports_clinic_portal_views.xml @@ -128,7 +128,7 @@