From d0e55f082b69331ef15d12ad55c3aad3c0958c85 Mon Sep 17 00:00:00 2001 From: "Victor Piryns (pivi)" Date: Thu, 27 Apr 2023 05:56:22 +0000 Subject: [PATCH] [FIX] project: correct pager of project portal view Current behaviour: If a project has more than 80 tasks, there is pagination activated in the project portal view. But when clicking on the second page, we are requested to login, even when we come from a shared link. Expected behaviour: You should be able to scroll through the pages of tasks related to the shared project without being requested to login. Steps to reproduce: - Install Project - Create 100+ tasks in 1 project - Copy the share link of that project. - Log out, open the shared link. - Go to page 2 of the tasks -> login request. Reason for the problem: Missing `access_token` in the pager urls to browse through the tasks. Fix: Add the `access_token` as url argument in the links when creating the pager for the portal view. Affected versions: - 16.0 - saas-16.1 - saas-16.2 - master opw-3220659 closes odoo/odoo#120546 X-original-commit: 87b3f6d865cddb91def5af2603c44e8e2a68b04c Signed-off-by: Xavier Bol (xbo) Signed-off-by: Piryns Victor (pivi) --- addons/project/controllers/portal.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/addons/project/controllers/portal.py b/addons/project/controllers/portal.py index 7f14127abbd..28c45da5a6b 100644 --- a/addons/project/controllers/portal.py +++ b/addons/project/controllers/portal.py @@ -34,6 +34,10 @@ class ProjectCustomerPortal(CustomerPortal): # pager url = "/my/projects/%s" % project.id values = self._prepare_tasks_values(page, date_begin, date_end, sortby, search, search_in, groupby, url, domain, su=bool(access_token), project=project) + # adding the access_token to the pager's url args, + # so we are not prompted for loging when switching pages + # if access_token is None, the arg is not present in the URL + values['pager']['url_args']['access_token'] = access_token pager = portal_pager(**values['pager']) values.update(