콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
1 회신
2573 화면

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.  

아바타
취소
작성자 베스트 답변

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


아바타
취소
관련 게시물 답글 화면 활동
1
3월 24
1747
1
11월 23
5535
1
6월 24
1863
4
5월 24
1669
Website Issue 해결 완료
1
4월 24
2520