Se rendre au contenu
Odoo Menu
  • Se connecter
  • Essai gratuit
  • Applications
    Finance
    • Comptabilité
    • Facturation
    • Notes de frais
    • Feuilles de calcul (BI)
    • Documents
    • Signature
    Ventes
    • CRM
    • Ventes
    • PdV Boutique
    • PdV Restaurant
    • Abonnements
    • Location
    Sites web
    • Site Web
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Chaîne d'approvisionnement
    • Inventaire
    • Fabrication
    • PLM
    • Achats
    • Maintenance
    • Qualité
    Ressources Humaines
    • Employés
    • Recrutement
    • Congés
    • Évaluations
    • Recommandations
    • Parc automobile
    Marketing
    • Marketing Social
    • E-mail Marketing
    • SMS Marketing
    • Événements
    • Marketing Automation
    • Sondages
    Services
    • Projet
    • Feuilles de temps
    • Services sur Site
    • Assistance
    • Planification
    • Rendez-vous
    Productivité
    • Discussion
    • Validations
    • Internet des Objets
    • VoIP
    • Connaissances
    • WhatsApp
    Applications tierces Odoo Studio Plateforme Cloud d'Odoo
  • Industries
    Commerce de détail
    • Librairie
    • Magasin de vêtements
    • Magasin de meubles
    • Épicerie
    • Quincaillerie
    • Magasin de jouets
    Food & Hospitality
    • Bar et Pub
    • Restaurant
    • Fast-food
    • Guest House
    • Distributeur de boissons
    • Hotel
    Real Estate
    • Real Estate Agency
    • Cabinet d'architecture
    • Construction
    • Gestion immobilière
    • Jardinage
    • Association de copropriétaires
    Consulting
    • Accounting Firm
    • Partenaire Odoo
    • Agence Marketing
    • Cabinet d'avocats
    • Aquisition de talents
    • Audit & Certification
    Fabrication
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Cadeaux d'entreprise
    Santé & Fitness
    • Club de sports
    • Opticien
    • Salle de fitness
    • Praticiens bien-être
    • Pharmacie
    • Salon de coiffure
    Trades
    • Bricoleur
    • Matériel informatique et support
    • Solar Energy Systems
    • Cordonnier
    • Services de nettoyage
    • HVAC Services
    Others
    • Nonprofit Organization
    • Agence environnementale
    • Location de panneaux d'affichage
    • Photographie
    • Leasing de vélos
    • Revendeur de logiciel
    Browse all Industries
  • Communauté
    Apprenez
    • Tutoriels
    • Documentation
    • Certifications
    • Formation
    • Blog
    • Podcast
    Renforcer l'éducation
    • Programme éducatif
    • Business Game Scale-Up!
    • Rendez-nous visite
    Obtenir le logiciel
    • Téléchargement
    • Comparez les éditions
    • Versions
    Collaborer
    • Github
    • Forum
    • Événements
    • Traductions
    • Devenez partenaire
    • Services for Partners
    • Enregistrer votre cabinet comptable
    Nos Services
    • Trouver un partenaire
    • Trouver un comptable
    • Rencontrer un conseiller
    • Services de mise en œuvre
    • Références clients
    • Assistance
    • Mises à niveau
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Obtenir une démonstration
  • Tarification
  • Aide

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

  • CRM
  • e-Commerce
  • Comptabilité
  • Inventaire
  • PoS
  • Projet
  • MRP
All apps
Vous devez être inscrit pour interagir avec la communauté.
Toutes les publications Personnes Badges
Étiquettes (Voir toutl)
odoo accounting v14 pos v15
À propos de ce forum
Vous devez être inscrit pour interagir avec la communauté.
Toutes les publications Personnes Badges
Étiquettes (Voir toutl)
odoo accounting v14 pos v15
À propos de ce forum
Aide

Pagination on website custom

S'inscrire

Recevez une notification lorsqu'il y a de l'activité sur ce poste

Cette question a été signalée
limitpaginationodoo10
1 Répondre
11264 Vues
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
Ignorer
Avatar
Haresh Kansara
Meilleure réponse

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
Ignorer
Vous appréciez la discussion ? Ne vous contentez pas de lire, rejoignez-nous !

Créez un compte dès aujourd'hui pour profiter de fonctionnalités exclusives et échanger avec notre formidable communauté !

S'inscrire
Publications associées Réponses Vues Activité
How to set limit of items for one2many list view?
one2many limit pagination
Avatar
1
mars 15
7763
Approval process in the purchase app in Odoo 10
purchase limit rfq odoo10
Avatar
Avatar
1
févr. 18
4569
Create schedule action For sending emails
odoo10
Avatar
Avatar
Avatar
2
juil. 25
6391
How to send messages that are not shown in chatter? Résolu
odoo10
Avatar
Avatar
Avatar
2
oct. 25
8760
How to ORDER BY? [Odoo 10] Résolu
odoo10
Avatar
Avatar
2
nov. 24
29645
Communauté
  • Tutoriels
  • Documentation
  • Forum
Open Source
  • Téléchargement
  • Github
  • Runbot
  • Traductions
Services
  • Hébergement Odoo.sh
  • Assistance
  • Migration
  • Développements personnalisés
  • Éducation
  • Trouver un comptable
  • Trouver un partenaire
  • Devenez partenaire
À propos
  • Notre société
  • Actifs de la marque
  • Contactez-nous
  • Emplois
  • Événements
  • Podcast
  • Blog
  • Clients
  • Informations légales • Confidentialité
  • Sécurité.
الْعَرَبيّة 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 est une suite d'applications open source couvrant tous les besoins de votre entreprise : CRM, eCommerce, Comptabilité, Inventaire, Point de Vente, Gestion de Projet, etc.

Le positionnement unique d'Odoo est d'être à la fois très facile à utiliser et totalement intégré.

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