[FIX] website_blog: fix pager when existing filters in url

Go to a URL such as `/blog/our-news-1?date_begin=2015-01-01`
Now click on page 2.

Without this patch you will go to `/blog/our-news-1?date_begin=2015-01-01/page/2`.
With this patch, you will go to `/blog/our-news-1/page/2?date_begin=2015-01-01`.

This commit closes #13206
This commit is contained in:
Jairo Llopis 2016-08-18 16:50:41 +02:00 committed by Jeremy Kersten
parent 29f5719254
commit 4faed0b792
1 changed files with 2 additions and 1 deletions

View File

@ -127,10 +127,11 @@ class WebsiteBlog(http.Controller):
blog_posts = blog_post_obj.browse(cr, uid, blog_post_ids, context=context)
pager = request.website.pager(
url=blog_url(),
url=request.httprequest.path,
total=len(blog_posts),
page=page,
step=self._blog_post_per_page,
url_args=opt,
)
pager_begin = (page - 1) * self._blog_post_per_page
pager_end = page * self._blog_post_per_page