Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
3423 มุมมอง

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"}'
อวตาร
ละทิ้ง
ผู้เขียน

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}'

ผู้เขียน

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)"

คำตอบที่ดีที่สุด

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

อวตาร
ละทิ้ง

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

ผู้เขียน

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

Related Posts ตอบกลับ มุมมอง กิจกรรม
6
ก.พ. 24
8137
0
มี.ค. 22
4
1
ส.ค. 21
2975
3
ก.ย. 25
2673
0
ส.ค. 25
260