diff --git a/resource_booking/controllers/portal.py b/resource_booking/controllers/portal.py index b8338cdd..bf518341 100644 --- a/resource_booking/controllers/portal.py +++ b/resource_booking/controllers/portal.py @@ -26,8 +26,9 @@ def _get_booking_sudo(self, booking_id, access_token): def _prepare_home_portal_values(self, counters): """Compute values for multi-booking portal views.""" values = super()._prepare_home_portal_values(counters) - booking_count = request.env["resource.booking"].search_count([]) - values.update({"booking_count": booking_count}) + if "booking_count" in counters: + booking_count = request.env["resource.booking"].search_count([]) + values.update({"booking_count": booking_count}) return values def _booking_get_page_view_values(self, booking_sudo, access_token, **kwargs):