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.

1

How to add a custom css?

By
Michael Karrer
on 3/13/13, 4:50 AM 19,536 views

What is the best way to add custom css to openerp 7 without modifying any original file of openerp?

This question has been included in the official documentation.
8

Mohammad Alhashash

--Mohammad Alhashash--
2075
| 5 5 8
Giza, Egypt
--Mohammad Alhashash--

Developer

Mohammad Alhashash
On 3/13/13, 5:10 AM

Just create a module and add your css file in __openerp__.py as described in the documentation.

 # __openerp__.py
 {
     'name': "CSS Example",
     'description': "new css example",
     'category': 'Generic Modules/Others',
     'depends': ['web'],
     'data': [],
     'css': ['static/src/css/my_css.css'],
 }

Thank you! - Trunk docu is growning pretty fast - a good sign :)

Michael Karrer
on 3/13/13, 5:26 AM
This question has been included in the official documentation.
7

swapnil wagh

--swapnil wagh--
1559
| 6 5 8
Pune, India
--swapnil wagh--

My name is Swapnil A. Wagh. I studied Master Of computer Science and work as a Software Engineer. I’m a technology enthusiast and always eager to learn new and exciting technologies. I’m constantly looking for innovative solutions to age-old problems that push the limits of what we conceive to be possible.

swapnil wagh
On 10/11/14, 3:15 AM

Yes it will not work in odoo 8, in odoo 8 you need to inherit the css template in your module and include your css file there e.g

<template id="my_assets_id" name="website assets for my module" inherit_id="website.theme">
        <xpath expr="." position="inside">
        <link rel="stylesheet" href="/website_my_module/static/src/css/my.css"/>
        </xpath>
    </template>

 

I can't get any good result! My css isn't loaded yet!

Mohammad Emami
on 10/11/14, 4:13 AM

It would be helpful if you could also tell us where to put the file, how to name it (if there is a naming convention) and how to configure __openerp__py accordingly, since everything I tried results in a 500 Odoo Server error.

Apprique
on 10/24/14, 10:25 AM

Is there only one guy here who managed to use a custom CSS in odoo?

Pascal Tremblay
on 12/26/14, 12:50 PM

Which extension should the file have? .py? .xml?

Pascal Tremblay
on 12/26/14, 12:52 PM

Much better for Odoo v8 : https://www.odoo.com/forum/help-1/question/how-to-change-existing-css-creating-a-new-module-46099

Pascal Tremblay
on 12/26/14, 1:09 PM
This question has been included in the official documentation.
3
Laurent Destailleur
On 1/7/15, 9:05 AM

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>

 

This question has been included in the official documentation.
0
Sayed Anisul Hoque
On 8/28/15, 3:14 PM

Try as like this. It worked fine for me:

<template id="report.style" name="style">

<style type="text/css">

body {

color: #000 !important;

}

.background {

background-color: blue;

}

.p {

font-size: 22px;

color: green;

}

<!-- More of CUSTOM CSS here -->

</style>

</template>

This question has been included in the official documentation.
0
Nicolas de Moreau
On 11/26/16, 1:13 AM

The right answer is here: http://www.odoo.yenthevg.com/adding-static-resources-css-and-javascript-to-odoo/

This question has been included in the official documentation.
0
Dr Obx
On 11/16/15, 6:24 AM

Looking for solution> trying to make vartical labels in tree view.

In my case, css is loaded but I cant make it work ... :(

Whatever I change in css I can't see it in tree view.

This question has been included in the official documentation.
0
Vianney Adou
On 7/23/15, 6:54 AM

thank you Laurent Destailleur for answer.

It work for me !

This question has been included in the official documentation.
0

Pascal Tremblay

--Pascal Tremblay--
1312
| 5 2 7
Alma, Canada
--Pascal Tremblay--


Pascal Tremblay
On 12/26/14, 12:48 PM

https://github.com/odoo/odoo/issues/4359

This question has been included in the official documentation.
0
Mohammad Emami
On 10/11/14, 2:46 AM

I think that this does not work in odoo 8.0, isn't it?!

still searching too!

Pascal Tremblay
on 12/26/14, 12:43 PM
This question has been included in the official documentation.
0
Rizo
On 10/30/14, 12:13 PM

That doesn't work for me too on Odoo.

Neither with the css directly in my module nor inheriting template

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

6 follower(s)

Stats

Asked: 3/13/13, 4:50 AM
Seen: 19536 times
Last updated: 11/26/16, 1:13 AM