Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
1 Rispondi
2574 Visualizzazioni

I found that the editor in the website module does not work if you are running Odoo on premises without a connection to the internet.

On a fresh install of Odoo 17 CE, with the Website module installed, when you click Edit​ on any website page, the editor does not open up.  After some seconds 2 error message boxes are displayed.

If you examine the requests that are being executed in the browser dev tools, you will see that it is attempting to access fonts.googleapis.com​ for all of the various fonts that are part of whatever website theme has been set up for the website.

I was not able to get past this error.

I believe I have tracked this down to the following file:

addons/website/static/src/scss/website\.wysiwyg\.scss

It\ appears\ that\ there\ is\ a\ bug\ in\ this\ code\ which\ is\ causing\ it\ to\ always\ default\ to\ attempting\ to\ read\ the\ fonts\ from\ fonts.googleapis.comwhen it should default to reading the fonts from the local website theme on disk.

I solved this for my immediate needs by commenting out the conditional logic. I will post this as a reply as a solution to this problem, in case anyone else runs into it.  

Avatar
Abbandona
Autore Risposta migliore

This solution is a hack and only solves the problem for this exact scenario of on premises with no internet connection. But it did solve the problem so I am posting it in case it is of use to others.

In the file: addons/website/static/src/scss/website\\.wysiwyg\\.scss

Change\ the\ very\ first\ part\ of\ the\ file\ to\ comment\ out\ the\ if\-else\ clauses\ and\ only\ execute\ what\ was\ the\ else​\ logic\.\ This\ forces\ it\ to\ use\ the\ fonts\ from\ the\ website\ theme\ on\ disk\ rather\ than\ going\ to\ googleapis\.com\.

Below\ is\ the\ code\ with\ lines\ commented\ out:

@each\ \$font\-name,\ \$font\-config\ in\ \$o\-theme\-font\-configs\ \{
//\$url:\ map\-get\(\$font\-config,\ 'url'\);
// \ @if\ \$url\ \{
// \  \ @import\ url\("https://fonts.googleapis.com/css?family=#{unquote($url)}&display=swap");
//    } @else {
        $name: map-get($font-config, 'name');
        $attachment: map-get($font-config, 'attachment');
        @if $attachment {
            @import url("/web/content/#{$attachment}/google-font-#{unquote($name)}");
      }
// }
}


Avatar
Abbandona
Post correlati Risposte Visualizzazioni Attività
1
mar 24
1748
1
nov 23
5536
1
giu 24
1865
4
mag 24
1669
1
apr 24
2521