Odoo Help

Welcome!

This community 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.

1

Is there a way to list all objects available to a template?

By
Jeff Beidler
on 1/19/15, 7:49 PM 412 views

When working on QWeb views, is there some means of finding out which objects are available, without knowing them by name?  For instance, I would think that "company" should be available from almost all templates, but I'm finding that it's not set in the template which outputs order lines.  Is there a magic trick, or specialized function?

0
Shawn Varghese
On 1/20/15, 1:25 AM

I have also been looking for the answer to this question. The only thing I could find was that, in case I'm looking for something in order line template, I query the sale_order_line table for all the available columns. There is a company_id column in the sale_order_line table. So we can access company name as "l.company_id.name", as illustrated in the following code:

<tr t-foreach="o.order_line" t-as="l">
                                    <td>
                                        <span t-field="l.company_id.name"></span>
                                    </td>

</tr>

But I guess you have already tried this.

I'm also searching for one that would give all available attributes - it would speed up report development a lot.

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 1/19/15, 7:49 PM
Seen: 412 times
Last updated: 3/16/15, 8:10 AM