Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
2 Risposte
15092 Visualizzazioni

If I have some calculated value and I want to display it on report.

For example

<t t-set="price_unit" t-value="get_price_unit(l)"/>
<span t-esc="price_unit"/>

The only thing I could use in the previous versions was formatLang, but that is a webkit method and Odoo 10 doesn't have that anymore. Is there any other way to format the number and it's thousands separator in qweb?



Avatar
Abbandona
Risposta migliore

I needed to show a thousand separator in a Qweb invoice field and I succeeded with the following  expression

<tr t-foreach="o.invoice_line" t-as="l">
...      <td><span t-esc="'{:,}'.format(l.price_subtotal)"/></td>
</tr>

 

Avatar
Abbandona
Risposta migliore

Hi,


Please check this,

<t t-esc="'{0:,.0f}'.format(price_unit)" />

Thanks
Aswini iWesabe
Avatar
Abbandona
Post correlati Risposte Visualizzazioni Attività
7
ago 19
24797
0
set 18
4341
0
lug 17
3789
0
mar 17
4672
4
dic 23
43323