I want to use HTML Rich Text field on Website form. We can use widget="html" on odoo forms field but how can we use this widget on website form of odoo v12? Thanks in advance.
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Accounting
- Inventory
- PoS
- Project management
- MRP
This question has been flagged
Actually you know it and already used it :)
This is an odoo website forum(website page) and I am currently writing in a rich text editor. in the backend, this is Html field.
Ok so take fields.HTML in backend instead of Text so the server will do all the HTML sanitization work for you and the user could not inject any unsafe code.
Create a custom route for post and define HTML form with your field
https://github.com/odoo/odoo/blob/12.0/addons/website_forum/views/website_forum.xml#L558 (here content is html field)
and last, initialize it with summernote editor on this field (here it's done by load_editor class
https://github.com/odoo/odoo/blob/12.0/addons/website_forum/views/website_forum.xml#L558
I added class load_editor in my html field. But it seems that its not just adding class, Some JS code is also required to render HTML editor. I tried following JS in my module but no luck.
(summernote initialized here.)
Enjoying the discussion? Don't just read, join in!
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign up