Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
1 Rispondi
3331 Visualizzazioni

Can t-esc-options and t-field-options options be used in the product template id like below?


span t-field="product.list_price" t-field-options='{"widget": "monetary", "display_currency": "o.currency_id"}'
Avatar
Abbandona
Autore

I have explored different options but the currency symbol and currency precision are not displayed...

t t-set="rrp" t-value="product.list_price"

span t-esc="rrp" t-esc-options='{"widget": "monetary", "display_currency": "currency"}'

span t-esc="rrp" t-esc-options='{"widget": "float", "precision": 2}'

Autore

The following works, formatting when setting the variable, but it's more hard coding that is not good...

t t-set="rrp" t-value="'{:.2f}'.format(product.list_price)"

Risposta migliore

Hello Anthony Nelson,

You can use the below code, maybe it's useful for you.

Fine Code in Comment.


Thanks & Regards,
Email: odoo@aktivsoftware.com
Skype: kalpeshmaheshwari

Avatar
Abbandona

<t t-esc="product.list_price" t-options='{"widget": "float", "precision": 2}'/><t t-esc="product.currency_id.symbol"/>

Autore

Thank you Jainesh! That works! I swapped the value and currency symbol around.

Post correlati Risposte Visualizzazioni Attività
6
feb 24
8008
0
mar 22
4
1
ago 21
2899
1
lug 25
2504
2
lug 25
7941