콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
1 회신
3556 화면

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
2월 24
8346
0
3월 22
4
1
8월 21
3099
3
9월 25
2922
0
8월 25
526