Odoo Help

0
2
Axel Mendoza
On 10/17/15, 7:45 PM

Hi @E.M

When you define the attribute t-field on a html node, not available for ("table", "tbody", "thead", "tfoot", "tr", "td", "li", "ul", "ol", "dl", "dt", "dd", "t"), you are saying that your t-field expression result could be modified by the values of t-field-options attribute that let you specify a number a dict items depending of every case but most important ones is the widget item that let you change the default field widget in qweb to render the field result, in your case the widget contact is assigned to the class openerp.addons.base.ir.ir_qweb.Contact that is the model 'ir.qweb.field.contact'. When you define the widget in the t-field-options dict string you are saying: Search for a model with the name prefixed with 'ir.qweb.field.' plus the t-field-options key widget value and use it to render the result of the t-field expression. In the case of the widget contact the implementation of the method record_to_html use the fields key to render the template 'contact' and in that template the 'no_marker' key is used.

That's the use of those t-field-options keys. The attribute t-field-options is a bag, a dict string that gets evaluated and passed to the default widget for the field type or for the widget option value and used to change the default render way of the field. In the case of the contact widget it operate over many2one values like o.partner_id you define it

Thanks Axel, and where is actually defined the "contact" widget? I understood that it is ir.qweb.field.contact, but how can you check what it actually does?

E.M.
on 10/19/15, 5:22 PM

The contact template is located at:
/openerp/addons/base/ir/ir_qweb.xml

Axel Mendoza
on 10/19/15, 5:29 PM

About This Community

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

Question tools

3 follower(s)

Stats

Asked: 10/17/15, 1:57 PM
Seen: 4913 times
Last updated: 6/10/18, 12:46 AM