Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

3

Qweb HTML report template inheritance

By
David
on 7/8/14, 10:04 AM 11,746 views

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!

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.

Ludo - Neobis
on 7/10/14, 10:40 AM

Hi Ludo, have you found a wa

Skillteam, Houssine BAKKALI
on 9/3/14, 6:53 AM

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

Skillteam, Houssine BAKKALI
on 9/3/14, 6:54 AM

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

Ludo - Neobis
on 9/3/14, 7:17 AM

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

Skillteam, Houssine BAKKALI
on 9/3/14, 7:20 AM

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

Skillteam, Houssine BAKKALI
on 9/3/14, 8:44 AM
7
Artur Bertram
On 8/7/14, 6:17 AM

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.

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

5 follower(s)

Stats

Asked: 7/8/14, 10:04 AM
Seen: 11746 times
Last updated: 11/7/16, 5:03 AM