From 0b78709d3a7bec2f6d1fcfa980025813d3fd7054 Mon Sep 17 00:00:00 2001 From: Yolann Sabaux Date: Tue, 11 Jan 2022 13:12:37 +0000 Subject: [PATCH] [FIX] website_blog: search query not consistent steps to reproduce: - install blog - create more than 12 articles with at least on word (the one we will search for) - Go to the "blog" menu of the website - Go in the search field - Search for the word in the created articles -> Odoo removes the search criteria on the blog (Website) + number of results is inconsistent OPW-2720355 closes odoo/odoo#83031 X-original-commit: bc2ed4a5f0997929930e3f279e5e1347818f8880 Signed-off-by: Romain Derie (rde) --- addons/website_blog/controllers/main.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/addons/website_blog/controllers/main.py b/addons/website_blog/controllers/main.py index 197dfc47945..d582a437aa5 100644 --- a/addons/website_blog/controllers/main.py +++ b/addons/website_blog/controllers/main.py @@ -121,11 +121,20 @@ class WebsiteBlog(http.Controller): first_post = posts[0] posts = posts[offset:offset + self._blog_post_per_page] + url_args = dict() + if search: + url_args["search"] = search + + if date_begin and date_end: + url_args["date_begin"] = date_begin + url_args["date_end"] = date_end + pager = request.website.pager( url=request.httprequest.path.partition('/page/')[0], total=total, page=page, step=self._blog_post_per_page, + url_args=url_args, ) if not blogs: