Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
2 Trả lời
9222 Lượt xem

I am extensively using the knowledge App and love the way Odoo restructured it in Odoo 17!


We are therefor migrating our old knowledgebase to Odoo 17. 
I am not a huge Fan of copying already formatted text, so I exported the raw HTML-Code of most of our articles (somewhere around 300). 


Does anyone know a way to insert the raw-HTML into HTML-Fields in Odoo?


In Odoo v14 there was the code view-Button, but I believe it was removed from v15 onward. 


Does anyone know a way around this? 


Ảnh đại diện
Huỷ bỏ
Tác giả Câu trả lời hay nhất

I found a way myself. 

You can inherit the body field (make sure, to only target the internal one) and add the option 'codeview': True​ to the dict of options.

Afterwards you can see the HTML-Code view in Debug Mode.


Before: 


After: 


But beware: 

If you are using the HTML-Code view in a shared article, editing will eventually not be saved. So make sure to use it on your own articles make sure to be the only editing person. 


Ảnh đại diện
Huỷ bỏ

Hi, can you explain what View are you inheriting? :) I'm trying and I cannot achieve the result... :(

Câu trả lời hay nhất

Ok, I did it too. The question is that you can only edit code when in Developer Mode (which it is very reasonable to avoid any user to inject code in the page).

Thanks for the idea :)


Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 8 24
1885
5
thg 3 22
15483
1
thg 7 25
53055
0
thg 12 17
3619
1
thg 6 15
6553