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

Hello,

I would like to inherit (or extends) the html_container template for a specific report, in order to add a CSS stylesheet.

Is it possible?

I tried with t-jquery, t-extend, ... but it does not seem to work.

Thanks!

Ảnh đại diện
Huỷ bỏ

I myself made a new report in Qweb format but am also very curious on how the CSS can be applied to the report. Especially given a custom CSS.

Hi Ludo, have you found a wa

Hi Ludo, have you found a way to do it so far?

No, unfortunately I haven't found a way yet.

ok thanks, we style looking for a way to insert our own css but apart replace the whole things in the header, it doesn't take any extra .css file declaration... bug or limitation? we don't know yet

the solution of jay vora from SerpentCS seems to be a solution to what appears to be a bug https://github.com/odoo/odoo/issues/1105

Câu trả lời hay nhất

In v8 you need to do it with xpath. An example for the header:

<?xml version="1.0" encoding="utf-8"?>
<openerp>
    <data>
        <template id="report_header_custom" inherit_id="report.external_layout_header">
            <xpath expr="//div[@class='header']" position="replace">
                <div class ="header">
                    Your Code
                </div>
            </xpath>
        </template>
    </data>
</openerp>

The id needs to be unique, or otherwise it will override an existing one.

The inherit_id is the modul name and the id of the report, which you want to extend or change.

The rest ist just standard odoo xpath.

I hope it helps.

Ảnh đại diện
Huỷ bỏ

thanks for your response

Bài viết liên quan Trả lời Lượt xem Hoạt động
4
thg 12 23
42940
3
thg 3 18
7865
8
thg 12 23
21980
1
thg 5 24
2961
1
thg 5 20
3744