Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
9718 Lượt xem

Step 1: I did add a Google Webfont to the common assets in a module with the following xml:

<openerp>
 <data>
     <!-- Adds all assets in Odoo -->
     <template id="assets_common" name="tw_custom_static_resources assets" inherit_id="web.assets_common">
         <xpath expr="." position="inside">
             <!--These links will be called when loading your Odoo -->
             <link rel="stylesheet" href="/tw_custom_static_resources/static/src/css/custom.css"/>
         </xpath>
     </template>
 </data>
</openerp>

The content of the custom.css file is the following:

@import url(https://fonts.googleapis.com/css?family=Open+Sans);

Step 2: I did add the file custom_reports.css to the report.assets_common by this xml template:

<openerp>
 <data>
     <!-- Adds all assets in Odoo -->
     <template id="assets_common" name="tw_custom_reports assets" inherit_id="report.assets_common">
         <xpath expr="." position="inside">
             <!--These links will be called when loading your Odoo -->
             <link rel="stylesheet" href="/tw_custom_reports/static/src/css/custom_reports.css"/>
         </xpath>
     </template>
 </data>
</openerp>

The content of the custom_reports.css file is

body{   font-family: 'Open Sans', sans-serif !important;
}

Unfortunately this does not work. Reports do not change the font and external reports loose the footer.

Remark: When I add the style attribute style="font-family: 'Open Sans', sans-serif;" directly to the header or footer tag in external header/footer reports layout, the proper font is applied.

Any idea on how to solve this is much appreciated.

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
0
thg 4 22
2061
0
thg 8 23
1775
0
thg 3 22
2
2
thg 6 19
4019
0
thg 1 17
5416