Odoo Help


Is there some conditions to respect to use widget in my qweb report?

Pascal Tremblay
on 2/19/16, 9:08 PM 3,917 views

Hello all, 

my new report is almost finished. But I did not manage to get only one widget working to format datas in this report. none

so may be i miss something

is there some important conditions to respect to get those widgets working?



Here is a easy test to show that widgets don't seem to work in my report.

In my report, I have put this code for diagnostic  :

<p>o = <span t-esc="o" /></p>

<p>currency = <span t-esc="currency" /></p>

<p>docs = <span t-esc="docs" /></p>

<p>doc_ids = <span t-esc="doc_ids" /></p>

<p>doc_model = <span t-esc="doc_model" /></p>

An here is the easy test I tried :

<t t-set="i" t-value="1666.435"/>

<td class="text-center" colspan="2"><span style="font-size: 20px;" t-esc="i"

t-field-options='{"widget": "monetary", "display_currency": "currency"}'/></td>

The result. See the variable currency is well defined.

Absolutely none dollar sign to the 1666.435 amount...


Since the beginning of my report conception, I ask to myself if I have the right docs, doc_ids and doc_model.

This report is launched from a wizard that I have made myself. Is it normal and correct that my docs and doc_model are  wizard.create.deposit (the model of the wizard)?

Is it normal that doc_ids is empty? 

My report works well even if I can't format with widgets in the qweb xml report.


Pascal Tremblay

--Pascal Tremblay--
| 5 3 7
Alma, Canada
--Pascal Tremblay--

Pascal Tremblay
On 2/20/16, 3:38 PM

YES!!!!! And YES again!

I have got result with this line :

<span t-esc="i" t-esc-options='{"widget": "monetary", "display_currency": "currency"}' />

Rather than this one :

<span t-esc="i" t-field-options='{"widget": "monetary", "display_currency": "currency"}' />

Strange thing however... the amount 1666.435 is rounded like 1666,43 $ and not like 1666,44 $. ??????

Mateo Tibaquira
On 12/22/16, 2:33 AM

You saved my day!! Thanks a lot

On the other hand, you have to use the currency of the report with:

"display_currency": o.currency_id

assuming o as your report object. Best regards

My pleasure!

Pascal Tremblay
on 12/22/16, 8:20 AM

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: 2/19/16, 9:08 PM
Seen: 3917 times
Last updated: 12/22/16, 2:33 AM