[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) <xbo@odoo.com> Signed-off-by: Piryns Victor (pivi) <pivi@odoo.com>
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user