From d183eae4226b90c2e87ac0f039d4d47b7b5ba3f7 Mon Sep 17 00:00:00 2001 From: "Turkesh Patel (Open ERP)" Date: Mon, 24 Feb 2014 18:06:44 +0530 Subject: [PATCH] [IMP] improved code to show total questions and improved domain show perfect values in pager bzr revid: tpa@tinyerp.com-20140224123644-2b9rm5zl14u0vkii --- addons/website_forum/controllers/main.py | 5 +++-- addons/website_forum/views/website_forum.xml | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/addons/website_forum/controllers/main.py b/addons/website_forum/controllers/main.py index 631ec401670..2060c52be7f 100644 --- a/addons/website_forum/controllers/main.py +++ b/addons/website_forum/controllers/main.py @@ -44,16 +44,17 @@ class website_forum(http.Controller): step = 10 question_count = forum_obj.search( - request.cr, request.uid, [], count=True, + request.cr, request.uid, [('parent_id', '=', False)], count=True, context=request.context) pager = request.website.pager(url="/questions/", total=question_count, page=page, step=step, scope=10) obj_ids = forum_obj.search( - request.cr, request.uid, [], limit=step, + request.cr, request.uid, [('parent_id', '=', False)], limit=step, offset=pager['offset'], context=request.context) question_ids = forum_obj.browse(request.cr, request.uid, obj_ids, context=request.context) values = { + 'total_questions': question_count, 'question_ids': question_ids, 'pager': pager, 'searches': searches, diff --git a/addons/website_forum/views/website_forum.xml b/addons/website_forum/views/website_forum.xml index 1b8c4853aad..44a631682f2 100644 --- a/addons/website_forum/views/website_forum.xml +++ b/addons/website_forum/views/website_forum.xml @@ -170,7 +170,7 @@
- + Question