Odoo pagination

Using kkpager plugin for Odoo Ajax pagination method

controllers/controllers.py
from odoo import http
from odoo.http import request
from odoo.addons.portal.controllers.portal import pager


class MyWeb(http.Controller):
    _news_per_page = 15
    
    @http.route(['/news/', '/news/?page/'], type='http', auth="public", methods=['GET', 'POST'], website=True)
    def news_list(self, page=1, **kw):
        news = request.env['my.news'].sudo()
        domain = []
        page_count = news.search_count(domain)
        # make pagination
        pagination = pager(
            url="/news",
            total=page_count,
            page=page,
            step=self._news_per_page,
        )
        records = news.sudo().search(
            domain, order="create_date desc", limit=self._news_per_page, offset=pagination['offset']
        )
    
        return request.render("my_website_module.news_list", {'records': records})

    @http.route('/news/', type='http', auth="public", methods=['GET', 'POST'], website=True)
    def news_detail(self, news_id=None, **kw):
        record = request.env['my.news'].sudo().browse(int(news_id)).exists()

        return request.render("my_website_module.news_detail", {'record': record})
        
    @http.route('/session_info.json', type='json', auth="public", methods=['POST'], website=True)
    def session_info(self, **kw):
        news_records = request.env['my.news'].sudo().search_count([])

        news_pages, a = divmod(news_records, self._news_per_page)
        if a:
            news_pages += 1

        return dict(
            news_pages=news_pages,
            news_records=news_records,
        )
my_website_module/templates/news_list_templates.xml