Odoo Help


How to add custome css class directly in QWEB report?

Prince Caspion
on 10/11/16, 5:14 AM 2,613 views

Hello All,

How to add custom css class directly in Qweb report template?




You can use style="...." directly in qweb

<div class="col-xs-5" style="border:1px solid lightgray; margin-left:16px;">
Shameem Babu @ iWesabe
On 10/27/16, 5:10 AM

Another way is Style element

<div class="page"> 
    <div class="oe_structure"/>
    <div class="row">
   <div class="col-xs-6">
                 .class-name{border:1px solid lightgray; margin-left:16px;}



Additional note: the style element has to be placed inside the page div. It won't work if it is placed before.

Jérôme Thériault
on 3/8/17, 11:24 AM
On 10/11/16, 1:14 PM


3Laurent DestailleurOn 1/7/15, 4:05 PM
If you are using Odoo v8, you must add this
        <template id="assets_backend" name="mymodule css assets" inherit_id="web.assets_backend">
            <xpath expr="." position="inside">
                <link rel="stylesheet" href="/my_module/static/src/css/my_module_css_file.css"/>            </xpath>        </template>

Does it work?

Ankit H Gandhi(AHG)
On 5/29/17, 9:19 AM

Hi Prince Caspion,

Kindly follow below step to create custom css class.

1.How to create css file in custom module.  

You should follow file structure like -


css file like:

.custom_css {

background-color: yellow;


2.Register your css file in main report template file like.

<template id="assets_common" name="your_module_name assets" inherit_id="report.assets_common">

 <xpath expr="." position="inside">

     <link href="/your_module_name/static/src/css/your_module_name.css" rel="stylesheet"/>



3.How to access css class in your report template.

<div class="text-center custom_css"><b>** Thank you **</b></div>

Hope this help you.

Best Thanks,

Ankit H Gandhi.

About This Community

This platform 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.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 10/11/16, 5:14 AM
Seen: 2613 times
Last updated: 5/29/17, 9:19 AM