Odoo Help


How to display data from an arbitrary model using Qweb ?

Najlaâ El Khayat (nel)
on 6/24/14, 3:00 AM 1,748 views

Suppose you'd like to display data from any existing model (custom or not).
How to search on the records you'd like to display? and how to show the values defined on this model ?


Search and browse on the object using "request.registry", like this:

 <t t-set-='ids' t-value="request.registry['product.product'].search(request.cr, 1, [('website_published','=',True),('category_id.name','ilike','website')], request.context)">

<t t-set-='prods' t-value="request.registry['product.product'].browse(request.cr, request.uid, ids, request.context)">

           <t t-foreach="prods" t-as="prod" class="col28-set">
                        <span t-field="prod.image" t-field-options="{"widget": "image"}" class="img" />

                       <span t-field="prod.name"/>



For the new API, use "request.env".

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 6/24/14, 3:00 AM
Seen: 1748 times
Last updated: 3/16/15, 8:10 AM