تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
1 الرد
3319 أدوات العرض

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.

المنشورات ذات الصلة الردود أدوات العرض النشاط
6
فبراير 24
8002
0
مارس 22
4
1
أغسطس 21
2898
1
يوليو 25
2477
2
يوليو 25
7924