Passa al contenuto
Odoo Menu
  • Accedi
  • Provalo gratis
  • App
    Finanze
    • Contabilità
    • Fatturazione
    • Note spese
    • Fogli di calcolo (BI)
    • Documenti
    • Firma
    Vendite
    • CRM
    • Vendite
    • Punto vendita Negozio
    • Punto vendita Ristorante
    • Abbonamenti
    • Noleggi
    Siti web
    • Configuratore sito web
    • E-commerce
    • Blog
    • Forum
    • Live chat
    • E-learning
    Supply chain
    • Magazzino
    • Produzione
    • PLM
    • Acquisti
    • Manutenzione
    • Qualità
    Risorse umane
    • Dipendenti
    • Assunzioni
    • Ferie
    • Valutazioni
    • Referral dipendenti
    • Parco veicoli
    Marketing
    • Social marketing
    • E-mail marketing
    • SMS marketing
    • Eventi
    • Marketing automation
    • Sondaggi
    Servizi
    • Progetti
    • Fogli ore
    • Assistenza sul campo
    • Helpdesk
    • Pianificazione
    • Appuntamenti
    Produttività
    • Comunicazioni
    • Approvazioni
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    App di terze parti Odoo Studio Piattaforma cloud Odoo
  • Settori
    Retail
    • Libreria
    • Negozio di abbigliamento
    • Negozio di arredamento
    • Alimentari
    • Ferramenta
    • Negozio di giocattoli
    Cibo e ospitalità
    • Bar e pub
    • Ristorante
    • Fast food
    • Pensione
    • Grossista di bevande
    • Hotel
    Agenzia immobiliare
    • Agenzia immobiliare
    • Studio di architettura
    • Edilizia
    • Gestione immobiliare
    • Impresa di giardinaggio
    • Associazione di proprietari immobiliari
    Consulenza
    • Società di contabilità
    • Partner Odoo
    • Agenzia di marketing
    • Studio legale
    • Selezione del personale
    • Audit e certificazione
    Produzione
    • Tessile
    • Metallo
    • Arredamenti
    • Alimentare
    • Birrificio
    • Ditta di regalistica aziendale
    Benessere e sport
    • Club sportivo
    • Negozio di ottica
    • Centro fitness
    • Centro benessere
    • Farmacia
    • Parrucchiere
    Commercio
    • Tuttofare
    • Hardware e assistenza IT
    • Ditta di installazione di pannelli solari
    • Calzolaio
    • Servizi di pulizia
    • Servizi di climatizzazione
    Altro
    • Organizzazione non profit
    • Ente per la tutela ambientale
    • Agenzia di cartellonistica pubblicitaria
    • Studio fotografico
    • Punto noleggio di biciclette
    • Rivenditore di software
    Carica tutti i settori
  • Community
    Apprendimento
    • Tutorial
    • Documentazione
    • Certificazioni 
    • Formazione
    • Blog
    • Podcast
    Potenzia la tua formazione
    • Programma educativo
    • Scale Up! Business Game
    • Visita Odoo
    Ottieni il software
    • Scarica
    • Versioni a confronto
    • Note di versione
    Collabora
    • Github
    • Forum
    • Eventi
    • Traduzioni
    • Diventa nostro partner
    • Servizi per partner
    • Registra la tua società di contabilità
    Ottieni servizi
    • Trova un partner
    • Trova un contabile
    • Incontra un esperto
    • Servizi di implementazione
    • Testimonianze dei clienti
    • Supporto
    • Aggiornamenti
    GitHub Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Richiedi una demo
  • Prezzi
  • Aiuto

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Contabilità
  • Magazzino
  • PoS
  • Progetti
  • MRP
All apps
È necessario essere registrati per interagire con la community.
Tutti gli articoli Persone Badge
Etichette (Mostra tutto)
odoo accounting v14 pos v15
Sul forum
È necessario essere registrati per interagire con la community.
Tutti gli articoli Persone Badge
Etichette (Mostra tutto)
odoo accounting v14 pos v15
Sul forum
Assistenza

[10] How to add custom font size to web editor menu.

Iscriviti

Ricevi una notifica quando c'è un'attività per questo post

La domanda è stata contrassegnata
editingwidget="html"
2 Risposte
16577 Visualizzazioni
Avatar
Vartan

Hello,


I don't find this one anywhere, must be some mean to add a custom font size to the HTML widget web editor. Default sizes are 'Default, 8, 9, 10, 11, 12, 14, 18', what if I want size 16 ?.

I believe the answer to this question would give me the answer to the next which is how to customize styles of the web editor.


Thanks for your help


Regards

V.

0
Avatar
Abbandona
Vartan
Autore

To do so, you'll have to build a module which inherits the Odoo web editor which is Summernote.

1- In your module Views folder, add a resources.xml file :

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

<odoo>

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

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

<script type="text/javascript" src="/ModuleName/static/src/js/summernote_overrides.js"></script>

</xpath>

</template>

</odoo>

2- In your module /static/src/js/ directory, add a summernote_overrides.js file :

odoo.define('web_editor.summernote_override', 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;

// disable some editor features

// XXX: this is not working, unfortunately but `options.styleTags` below is. weird :S

options.toolbar = [

['font', ['bold', 'italic', 'underline', 'superscript', 'clear']],

['para', ['ul', 'ol', 'paragraph']],

['height', ['height']],

['insert', ['link', 'picture', 'hr']],

['view', ['fullscreen', 'codeview']],

['help', ['help']],

['height', ['height']]

];

// limit style tags

options.styleTags = ['p', 'blockquote'];

options.fontSizes = [_t('Default'), 8, 9, 10, 11, 12, 13, 14, 16, 18, 24, 36, 48, 62];

return $.summernote;

});

3 - reference you first file in your __manifest__.py file so that it gets loaded.

'data': [

'views/blabla_view.xml',

'views/another_view.xml',

'views/resources.xml',

],

4 - Update your module in the Applications section.

Unfortunately the toolbar section doesn't work, only Styles et Font size are ok.

If anyone knows the solution that would be greatly appreciated.

V.

Avatar
Andrei Popa
Risposta migliore

I know is an old post but the solution is to change the inherit_id with value web_editor.summernote. I implemented this to Odoo 9 and the extra values for font sizes are rendered well. 

 

1
Avatar
Abbandona
Admin Samadeva

In Odoo v13 : in the above mentioned file: resources.xml : use inherit_id="web_editor.assets_wysiwyg"

Avatar
Sibert Aerts
Risposta migliore

As of v16 the answer is simpler:

In __manifest__.py add a new xml file to the "website.assets_wysiwyg" part:

"assets": {
​​"website.assets_wysiwyg": [
​​"my_addon/static/src/xml/web_editor_fontsizes.xml"
​],
}

Then in this new file web_editor_fontsizes.xml:

xml version="1.0" encoding="UTF-8"?>
<templates>
​​<t t-extend="web_editor.toolbar">
​​<xpath t-jquery="div#font-size>ul>li:has(>a[data-arg1=18px])" t-operation="after">
            <li><a class="dropdown-item" href="#" data-call="setFontSize" data-arg1="20px">20a>li>         xpath>
​t>
templates>

That adds an option of size 20 font after the 18 size one.

0
Avatar
Abbandona
Sibert Aerts

That XML code got really messed up and I get an error trying to edit it:

<templates>
​​<t t-extend="web_editor.toolbar">
​​<xpath t-jquery="div#font-size>ul>li:has(>a[data-arg1=18px])" t-operation="after">
            <li><a class="dropdown-item" href="#" data-call="setFontSize" data-arg1="20px">20</a></li>
        </xpath>
​</t>
</templates>

Ti stai godendo la conversazione? Non leggere soltanto, partecipa anche tu!

Crea un account oggi per scoprire funzionalità esclusive ed entrare a far parte della nostra fantastica community!

Registrati
Post correlati Risposte Visualizzazioni Attività
Possible to edit a confirmed sales order? Risolto
editing
Avatar
Avatar
Avatar
Avatar
Avatar
17
ott 18
33539
Rescrict edit's in Products and BoM
change editing
Avatar
Avatar
2
set 25
610
How to do I remove lines/edit from receipt on odoo online
receipt editing
Avatar
0
nov 23
2302
html widget doesn't show image odoo 15 view
widget="html" v15
Avatar
0
gen 22
3776
Mass Editing of Products in Odoo 15 Risolto
editing mass
Avatar
Avatar
1
ott 21
11565
Community
  • Tutorial
  • Documentazione
  • Forum
Open source
  • Scarica
  • Github
  • Runbot
  • Traduzioni
Servizi
  • Hosting Odoo.sh
  • Supporto
  • Aggiornamenti
  • Sviluppi personalizzati
  • Formazione
  • Trova un contabile
  • Trova un partner
  • Diventa nostro partner
Chi siamo
  • La nostra azienda
  • Branding
  • Contattaci
  • Lavora con noi
  • Eventi
  • Podcast
  • Blog
  • Clienti
  • Note legali • Privacy
  • Sicurezza
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo è un gestionale di applicazioni aziendali open source pensato per coprire tutte le esigenze della tua azienda: CRM, Vendite, E-commerce, Magazzino, Produzione, Fatturazione elettronica, Project Management e molto altro.

Il punto di forza di Odoo è quello di offrire un ecosistema unico di app facili da usare, intuitive e completamente integrate tra loro.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now