Hi, Anybody please explain me the difference between t-esc and t-raw in odoo qweb reporting
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- إدارة علاقات العملاء
- e-Commerce
- المحاسبة
- المخزون
- PoS
- Project
- MRP
لقد تم الإبلاغ عن هذا السؤال
Hi Karthik,
The difference is in HTML (code) parsing or not. When you use t-esc it will literally print out the value from the field you want to print. When you use t-raw in combination with an HTML field for example it will keep the content in HTML. If you would do a t-esc on an HTML field it will print your HTML code without interpreting it to actual code.
For example you have a field with:
<p>My code</p>
If you would use t-raw it will be handled as HTML and so your <p> element won't be shown because it is converted. When you would do the same with t-esc it would literally print <p>My code</p> on your report.
Yenthe
The documentation that explains this is at:
https://www.odoo.com/documentation/8.0/reference/qweb.html
https://www.odoo.com/documentation/9.0/reference/qweb.html
Hi Yenthe,
i have an html field
I want to change its font type. I tried:
<p style="font-family:serif;">
<span t-raw="doc.terms_and_condition"/>
</p>
It prints the content of that field. But font-type not converting to Serif
هل أعجبك النقاش؟ لا تكن مستمعاً فقط. شاركنا!
أنشئ حساباً اليوم لتستمتع بالخصائص الحصرية، وتفاعل مع مجتمعنا الرائع!
تسجيلالمنشورات ذات الصلة | الردود | أدوات العرض | النشاط | |
---|---|---|---|---|
|
3
ديسمبر 23
|
20202 | ||
|
1
أبريل 23
|
3110 | ||
|
0
سبتمبر 20
|
2906 | ||
|
1
نوفمبر 16
|
6423 | ||
|
0
مايو 15
|
5797 |