Skip to content

Instantly share code, notes, and snippets.

@foxcarlos
Last active November 19, 2019 12:46
Show Gist options
  • Save foxcarlos/76a18784b224307d269ff9b3731e2224 to your computer and use it in GitHub Desktop.
Save foxcarlos/76a18784b224307d269ff9b3731e2224 to your computer and use it in GitHub Desktop.
Paginacion en plantilla odoo
# page es lo que viene del template, el numero que se presiono
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,
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment