Skip to Content
Menu
This question has been flagged

I have create a new module ("webeditor_custom") to customize Odoo v13 Web editor Top menu to add custom font-sizes in the existing menu item.


The files in my module "webeditor_custom" are :

  1. templates/assets.xml file :

    <?xml version="1.0" encoding="utf-8" ?>

    <odoo>

    <template id="summernote_cust" name="My summernote assets" inherit_id="web_editor.summernote">

    <xpath expr="//script[last()]" position="after">

    <script type="text/javascript" src="/webeditor_custom/static/src/js/summernote_cust.js"></script>

    </xpath>

    </template>

    </odoo>



  1. In /static/src/js/ directory, i have my summernote_cust.js file :
odoo.define('web_editor.summernote_cust', function (require) {

'use strict';

var core = require('web.core');

var editor = require('web_editor.summernote');

require('summernote/summernote'); // wait that summernote is loaded

var _t = core._t;

var options = $.summernote.options;

options.fontSizes = [_t('Default'), 8, 9, 10, 11, 12, 13, 14, 16, 18, 21, 24, 28, 32, 36, 42, 49, 56, 63];

return $.summernote;

});
  1. my manifest.py file:
{
    "name": "Web editor custom",
    "summary": "Add font-sizes to the top-menu of the web editor",
    "version": "13.0.2.0.1",
    "installable": True,
    "depends": ["web_editor"],
    "data": ["templates/assets.xml"],
}

After installing my module, i get this error (popup) displayed on the first load of my homepage:

"Error: Service web_editor.summernote_cust already defined"

Thank you if you have a way to deal with it (summernote on odoo v13) or a workaround !


Avatar
Discard
Related Posts Replies Views Activity
2
Oct 22
14185
1
Dec 24
114
2
Nov 24
82
1
Oct 24
256
0
Sep 24
212