Skip to Content
Odoo Menu
  • Prijavi
  • Try it free
  • Aplikacije
    Finance
    • Knjigovodstvo
    • Obračun
    • Stroški
    • Spreadsheet (BI)
    • Dokumenti
    • Podpisovanje
    Prodaja
    • CRM
    • Prodaja
    • POS Shop
    • POS Restaurant
    • Naročnine
    • Najem
    Spletne strani
    • Website Builder
    • Spletna trgovina
    • Blog
    • Forum
    • Pogovor v živo
    • eUčenje
    Dobavna veriga
    • Zaloga
    • Proizvodnja
    • PLM
    • Nabava
    • Vzdrževanje
    • Kakovost
    Kadri
    • Kadri
    • Kadrovanje
    • Odsotnost
    • Ocenjevanja
    • Priporočila
    • Vozni park
    Marketing
    • Družbeno Trženje
    • Email Marketing
    • SMS Marketing
    • Dogodki
    • Avtomatizacija trženja
    • Ankete
    Storitve
    • Projekt
    • Časovnice
    • Storitve na terenu
    • Služba za pomoč
    • Načrtovanje
    • Termini
    Produktivnost
    • Razprave
    • Odobritve
    • IoT
    • Voip
    • Znanje
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Industrije
    Trgovina na drobno
    • Book Store
    • Trgovina z oblačili
    • Trgovina s pohištvom
    • Grocery Store
    • Trgovina s strojno opremo računalnikov
    • Trgovina z igračami
    Food & Hospitality
    • Bar and Pub
    • Restavracija
    • Hitra hrana
    • Guest House
    • Beverage Distributor
    • Hotel
    Nepremičnine
    • Real Estate Agency
    • Arhitekturno podjetje
    • Gradbeništvo
    • Estate Management
    • Vrtnarjenje
    • Združenje lastnikov nepremičnin
    Svetovanje
    • Računovodsko podjetje
    • Odoo Partner
    • Marketinška agencija
    • Law firm
    • Pridobivanje talentov
    • Audit & Certification
    Proizvodnja
    • Tekstil
    • Metal
    • Pohištvo
    • Hrana
    • Brewery
    • Poslovna darila
    Health & Fitness
    • Športni klub
    • Trgovina z očali
    • Fitnes center
    • Wellness Practitioners
    • Lekarna
    • Frizerski salon
    Trades
    • Handyman
    • IT Hardware & Support
    • Sistemi sončne energije
    • Izdelovalec čevljev
    • Čistilne storitve
    • HVAC Services
    Ostali
    • Neprofitna organizacija
    • Agencija za okolje
    • Najem oglasnih panojev
    • Fotografija
    • Najem koles
    • Prodajalec programske opreme
    Browse all Industries
  • Skupnost
    Learn
    • Tutorials
    • Dokumentacija
    • Certifikati
    • Šolanje
    • Blog
    • Podcast
    Empower Education
    • Education Program
    • Scale Up! Business Game
    • Visit Odoo
    Get the Software
    • Prenesi
    • Compare Editions
    • Releases
    Collaborate
    • Github
    • Forum
    • Dogodki
    • Prevodi
    • Become a Partner
    • Services for Partners
    • Register your Accounting Firm
    Get Services
    • Find a Partner
    • Find an Accountant
    • Meet an advisor
    • Implementation Services
    • Sklici kupca
    • Podpora
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Get a demo
  • Določanje cen
  • Pomoč

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Knjigovodstvo
  • Zaloga
  • PoS
  • Projekt
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Ključne besede (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Ključne besede (View all)
odoo accounting v14 pos v15
About this forum
Pomoč

Pagination on website custom

Naroči se

Get notified when there's activity on this post

This question has been flagged
limitpaginationodoo10
1 Odgovori
11344 Prikazi
Avatar
Jules

hi, i want to limit  display to 15 items, but i don't know how to create pagination in order to show all the rest of the records.

controllers.py : 

@http.route('/coopaname_helpdesk/liste_offres', type ='http', auth='public', website=True)
def liste_offres(self):

tickets = request.env['monmarchepublic'].sudo().search([] ,limit=15)
return http.request.render('coopaname_helpdesk.liste_offres', {'tickets': tickets })

my template.xml : 

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<record id="liste_offres" model="ir.ui.view">
<field name="name">coopaname_helpdesk.marchepublic</field>
<field name="inherit_id" ref="coopaname_helpdesk.marchepublic" />
<field name="mode">primary</field>
<field name="key">coopaname_helpdesk.liste_offres</field>
<field name="arch" type="xml">
<xpath expr="//div" position="after">
<div class="oe_structure" >
<div class="container" >

<t t-foreach="tickets" t-as="ticket">
<div class="col-md-4 col-xs-12 " style="text-align: center; ">
<div class="panel panel-primary">
<div class="panel-heading text-center" style="height:85px;" >
<h3 style="margin: 0" class="o_default_snippet_text"><span t-field="ticket.x_cat"/></h3>
<p style="margin: 0" class="o_default_snippet_text"><span t-field="ticket.x_date_order"/></p>
</div>
<div class="panel-body text-center text-muted" style="background-color: rgba(0,0,0,0.1); width: 350px; height:75px;">
<h3 style="margin: 0">
<b style="font-size: 25px; color: #8EA2C6" class="o_default_snippet_text"><span t-field="ticket.x_objet_consultation"/></b>
</h3>
</div>
<ul class="list-group" >
<li class="list-group-item o_default_snippet_text"><a t-attf-href="/coopaname_helpdesk/annonce/#{ticket.id}">#<t t-esc="ticket.id"/></a></li>
<li class="list-group-item o_default_snippet_text">Statut de l'offre : <span t-field="ticket.x_etape"/></li>
<li class="list-group-item o_default_snippet_text">Pouvoir Adjudicateur : <span t-field="ticket.x_admin"/></li>
<li class="list-group-item o_default_snippet_text">Ville du Pouvoir Adjudicateur: <span t-field="ticket.x_ville_adju"/></li>
<li class="list-group-item o_default_snippet_text">Date limite de dépot de candidature: <span t-field="ticket.x_date_limite"/></li>
</ul>
<div class="panel-footer text-center">
<p class="text-muted">
<i class="o_default_snippet_text"> Publié par : <span t-field="ticket.x_name"/></i>
</p>
<a t-attf-href="/coopaname_helpdesk/annonce/#{ticket.id}" class="btn btn-primary btn-lg o_default_snippet_text">Plus d'information</a>
</div>
</div>
</div>
</t>
</div>
</div>
</xpath>
</field>
</record>
</data>
</odoo>


0
Avatar
Opusti
Avatar
Haresh Kansara
Best Answer

Hi Jules,

Odoo provides default feature to manage website pagination. For that you have to render the pager values as below code.

model_ids = request.env[model_name].search([], offset=(page - 1) * 10, limit=10)
total = model_ids.search_count([])
pager = request.website.pager(
            url='url path',
            total=total,
            page=page,
            step=10,
        )

and you have to call website pager template in your custom template. For more information just see how Website sale(Shop) page work in odoo website. You will find solution. The above code is used for shop page.

Hope it will helpful for you.


Thanks and regards

Haresh Kansara

1
Avatar
Opusti
Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Prijavi
Related Posts Odgovori Prikazi Aktivnost
How to set limit of items for one2many list view?
one2many limit pagination
Avatar
1
mar. 15
7817
Approval process in the purchase app in Odoo 10
purchase limit rfq odoo10
Avatar
Avatar
1
feb. 18
4590
Create schedule action For sending emails
odoo10
Avatar
Avatar
Avatar
2
jul. 25
6489
How to send messages that are not shown in chatter? Solved
odoo10
Avatar
Avatar
Avatar
2
okt. 25
8823
How to ORDER BY? [Odoo 10] Solved
odoo10
Avatar
Avatar
2
nov. 24
29726
Community
  • Tutorials
  • Dokumentacija
  • Forum
Open Source
  • Prenesi
  • Github
  • Runbot
  • Prevodi
Services
  • Odoo.sh Hosting
  • Podpora
  • Nadgradnja
  • Custom Developments
  • Izobraževanje
  • Find an Accountant
  • Find a Partner
  • Become a Partner
About us
  • Our company
  • Sredstva blagovne znamke
  • Kontakt
  • Zaposlitve
  • Dogodki
  • Podcast
  • Blog
  • Stranke
  • Pravno • Zasebnost
  • Varnost
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo is a suite of open source business apps that cover all your company needs: CRM, eCommerce, accounting, inventory, point of sale, project management, etc.

Odoo's unique value proposition is to be at the same time very easy to use and fully integrated.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now