Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
2 Відповіді
2069 Переглядів

I’m encountering an issue with rendering an HTML field in QWeb on Odoo v17. This worked fine in v16, but in v17, I’m unable to properly display the HTML content using the t-out attribute.

Here’s a snippet of my code:

Model (my-model.ts):

pythonCopy codecontent = fields.Html('Content', translate=html_translate, sanitize=False)

Template (my-template.xml):

xmlCopy code

I expected the output to render properly formatted content (bold text, bullet points, quotes, headings, etc.). However, what I’m getting is the raw HTML tags displayed as plain text instead of being rendered as proper HTML.

Any suggestions on how to fix this or alternative approaches in Odoo v17?

Аватар
Відмінити
Найкраща відповідь

Hi,

Please try like this -


   <t t-field="doc.note"/>


Hope it helps

Аватар
Відмінити
Найкраща відповідь

I have nearly the same problem. For me it does not render properly. For example there is a table defined in html and it just loads the text in pdf even though in studio its shows correctly. Did you find any solutions?

Аватар
Відмінити
Related Posts Відповіді Переглядів Дія
1
вер. 25
630
1
лип. 25
2517
1
трав. 25
3039
1
квіт. 25
2940
1
лют. 25
2234