Bonjour j'ai besoin d'aide pour la création d'un bouton en bas de page (précedent 1,2,3,4,5,6... suivant) avez vous une solution merci
Hello I need help creating a button at the bottom of the page (previous 1,2,3,4,5,6... next) do you have a solution thank you
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Contabilidad
- Inventario
- PoS
- Project
- MRP
Se marcó esta pregunta
Hi,
What you need, I believe, is adding pagination at the bottom of the web page.
https://www.cybrosys.com/blog/how-to-add-pagination-odoo-website
Please refer to this blog to understand how to add pagination to web pages in odoo
Hope it helps
Hello, thank you very much for your answer.
I am a beginner in website creation, would it be possible to detail each step in order?
The module I use (Image - Text)
I would like to have 20 per page and then each time I add a new module it automatically shifts to the following pages.
Thank you very much for your help!
create py file in controller:
from odoo import http
from odoo.addons.website.controllers.main import Website
class CustomWebsite(Website):
@http.route(['/your-page'], type='http', auth="public", website=True)
def your_page(self):
# Add your logic to fetch the data and calculate pagination here
total_pages = 10
current_page = 1
return http.request.render('your_module.pagination_template', {
'total_pages': total_pages,
'current_page': current_page,
})
Create a QWeb template for the pagination (e.g., pagination_template.xml):
templates>
t t-name="your_module.pagination_template">
div class="pagination">
a t-if="current_page > 1" t-attf-href="/your-page?page=#{current_page-1}">< Previous
t t-set="range" t-value="range(1, total_pages+1)"/>
t t-foreach="range" t-as="page">
a class="active" t-if="page == current_page" t-attf-href="/your-page?page=#{page}">
t t-esc="page"/>
/a>
a t-else t-attf-href="/your-page?page=#{page}">
t t-esc="page"/>
/a>
/t>
a t-if="current_page < total_pages" t-attf-href="/your-page?page=#{current_page+1}">Next >
/div>
/t>
/templates>
Update your module's manifest file (__manifest__.py) to include the QWeb template:
'data': [ 'views/pagination_template.xml', ],
Make sure to update the URLs, module names, and templates according to your actual setup.
¿Le interesa esta conversación? ¡Participe en ella!
Cree una cuenta para poder utilizar funciones exclusivas e interactuar con la comunidad.
InscribirsePublicaciones relacionadas | Respuestas | Vistas | Actividad | |
---|---|---|---|---|
|
2
mar 23
|
9787 | ||
Cacher le bouton "créer" d'une liste
Resuelto
|
|
2
mar 23
|
2246 | |
Add class to button from function
Resuelto
|
|
2
may 22
|
4217 | |
|
0
mar 22
|
1495 | ||
|
1
may 21
|
4207 |
Thank you for the answers but I do not know where to put the lines that you propose to me...