This question has been flagged
5 Replies
12892 Views

Am I going crazy or is the <> code view button missing from the WYSIWYG code editor in Odoo 13.0 Community? I see it in some video tutorials others have made, but it's not present in my editor...

I'm trying to edit the template for an email - very basic stuff, except I cannot access the raw HTML since there's no <> button apparent in the editor on my screen to view the HTML underneath for the template. I've seen this button in many people's videos about the subject, and used it before in other applications.

If anyone knows where the button went to view HTML when editing an email template from the GUI, please help! Is there a stock Odoo app that lets you peek at that stuff? 

Anytime I edit something, it screws up the Jinja template underneath for the email template, but, I cannot fix the underlying HTML without digging into the actual server files.

Avatar
Discard
Best Answer

If you want to use HTML editor on any particular field, use an HTML widget.


Example:

In XML,

<field name="html_field" widget="html"/>


Avatar
Discard
Author Best Answer

Pablo, thanks for the reply. 

I have 

<field name="body_html" widget="html" options="{'style-inline': true}"/> 

for the email template editing View (when I inspect in development mode and go to edit form: view), however, there is still no option on the WYSIWYG inline toolbar to display source/code in the editor.

I've found out that I can force it to display raw text in there by changing to widget="text" but that's not an ideal solution since I have to open the XML and manually switch back and forth.

Is there something else I'm missing that can get the source code view option back on the toolbar of the editing widget?


Avatar
Discard

I have the same issue - while changing the widget type to "text" in the view mail.template is a workaround - i hope someone will provide a solution to get the '<>' Button to switch between 'source' and 'wysiwyg' mode...

Best Answer

I have tried this in Odoo 14, so I'm not sure whether it will work in version 13, but you can insert the html of the code view button somewhere in the toolbar and the button will be working as expected: <button type="button" class="btn btn-secondary btn-sm" title="" data-event="codeview" tabindex="-1" data-name="codeview" data-original-title="Code View"><i class="fa fa-code"></i></button>

An easier solution is to directly edit the page html, modify the mail body and Odoo will accept the change.

Avatar
Discard
Best Answer

Try with debug mode activated. You will then see Codeview

Avatar
Discard
Best Answer

The options="{'style-inline':'true'}" is the solution to the question!! Just adding the widget is not enough.

The Ckeditor configuration option style-inline has to be set to true... Until today i was used to configure ckeditor settings via an ckeditor.js file, but in the odoo context i am not able to identifiy how to overwrite an existing config file or add an own file via a custom addon.. If anyone knows how to implement an own ckeditor.js config file, please let us know =)

Avatar
Discard