[FIX] project: add route to manage page in '/my/projects/:project_id'

Before this commit, we recently change the content of this route. The
content is the list of tasks to the project instead of the form view of
the project. The problem is we don't have a route to manage the page in
the case where we have more than the value stored in `_items_per_page`.

This commit adds a route in the method for '/my/projects/:project_id'
route. The new route is called '/my/projects/:project_id/page/:page' to
manage the page of the tasks linked to the project.

task-2648955

Closes #82379
This commit is contained in:
Xavier BOL (xbo)
2022-02-14 13:22:48 +01:00
parent 25ece8fe7b
commit 336befc0fb
+1 -1
View File
@@ -103,7 +103,7 @@ class ProjectCustomerPortal(CustomerPortal):
""" Redirect the outdated routes to the new routes. """
return request.redirect(request.httprequest.path.replace('/my/task', '/my/tasks'))
@http.route(['/my/projects/<int:project_id>'], type='http', auth="public", website=True)
@http.route(['/my/projects/<int:project_id>', '/my/projects/<int:project_id>/page/<int:page>'], type='http', auth="public", website=True)
def portal_my_project(self, project_id=None, access_token=None, page=1, date_begin=None, date_end=None, sortby=None, search=None, search_in='content', groupby=None, task_id=None, **kw):
try:
project_sudo = self._document_check_access('project.project', project_id, access_token)