Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
1 Odpowiedz
2520 Widoki

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.  

Awatar
Odrzuć
Autor Najlepsza odpowiedź

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)}");
      }
// }
}


Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
1
mar 24
1705
1
lis 23
5478
1
cze 24
1813
4
maj 24
1624
Website Issue Rozwiązane
1
kwi 24
2186