Community mailing list archives

Re: [8.0] Qweb question for float/integer widget

Atchuthan - Technical Consultant, Sodexis Inc
- 04/17/2015 02:46:17
Hi Yonathan,

Try to use formatLang
<span t-esc="formatLang(o.product_qty, digits=0)" />

Assuming 'Account' decimal.precision=3:
                formatLang(value) -> digits=2 (default)
                formatLang(value, digits=4) -> digits=4
                formatLang(value, dp='Account') -> digits=3
                formatLang(value, digits=5, dp='Account') -> digits=5

For more info: check the code @ github from this link

On 04/17/2015 11:17 AM, Hans Yonathan wrote:
<blockquote cite="mid:005d01d078d1$6d80cd00$48826700$" type="cite">

Hi Odoo Community,


So I am in the middle to migrate the report from RML to Qweb,


I found this code in RML [[ formatLang(o.product_qty, digits=0) ]]

So in this code, we display the qty without digit precision.


How I migrate this code to qweb?


As my code in qweb I did this:


<span t-field=”o.product_qty” t-field-options=’{“digits”:0}’ />


And its not worked, it just display the qty with digit precision.


If I did this:

<span t-raw=”o.product_qty” />


<span t-raw=”o.product_qty”  t-field-options=’{“widget”:’integer’}’ />


The display will be: 1.0

What I want is just :1

Without digit precision.


How can I do that? Is there any people that know it?




Thank You.


Best Regards,

Hans Yonathan

Odoo Support


Expert in Finance, Information System & Business Intelligence

Odoo Silver Partner


Tel. 13670137019 (China - Shenzhen)


Post to: