Odoo Help

3

3
20 Answers
9
Avatar

Mohammad Alhashash Egypt

--Mohammad Alhashash--
2103
| 6 5 10
October City, Egypt
--Mohammad Alhashash--

Developer

Mohammad Alhashash Egypt
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'],
 }
1 Comment
Michael Karrer Austria
3/13/13, 5:26 AM

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

8
Avatar

swapnil wagh India

--swapnil wagh--
1594
| 6 5 10
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 India
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>

 

5 Comments
Mohammad Emami Iran
10/11/14, 4:13 AM

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

Apprique Hong Kong
10/24/14, 10:25 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.

La Page PT, Pascal Tremblay Canada
12/26/14, 12:50 PM

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

La Page PT, Pascal Tremblay Canada
12/26/14, 12:52 PM

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

La Page PT, Pascal Tremblay Canada
12/26/14, 1:09 PM

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

4
Laurent Destailleur France
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>

 

2
Avatar

Hilar AK Oman

--Hilar AK--
17588
| 7 6 11
Muscut, Oman
--Hilar AK--
Experienced Odoo / Python Developer with a demonstrated history of working in the information technology and services industry with 3.5+years of experience. Skilled in Python, PostgreSQL, SQL, HTML, JavaScript. Strong engineering professional with a Bachelor of Technology (BTech) focused on Computer Science from the College of Engineering Munnar.

 Blogs:-

https://medium.com/@hilarak
https://hilarlive.wordpress.com/
 StackOverflow:
       https://stackoverflow.com/users/7561347/burmese-pythis-hilar-ak

Hilar A.K

AL Sabla Digital Solutions LLC

Office: +968 24121299 Mobile: +968 71026998
P.O Box  2839, P.C 112, Ruwi, Sultanate of Oman




Hilar AK Oman
1/20/17, 8:39 AM

if you need to write custom css in frontend odoo then you please try (1) , in case of backend try (2):

1:
    <template id="id" name="your name" inherit_id="website.assets_frontend">
      <xpath expr="." position="inside">
         <link href="/youraddon/static/src/css/yourcssfilename.css" rel="stylesheet" type="text/css"/>
    </xpath>
    </template>
2:
     <template id="id" name="your name" inherit_id="website.assets_backend">
         <xpath expr="." position="inside">
             <link href="/youraddon/static/src/css/yourcssfilename.css" rel="stylesheet" type="text/css"/>
         </xpath>
     </template>

1
Sayed Anisul Hoque Bangladesh
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>

1
Avatar

Shameem Babu @ iWesabe Saudi Arabia

--Shameem Babu @ iWesabe--
GLOBAL CREATIVE CONCEPTS TECH CO LTD
http://www.iwesabe.com
1598
| 6 3 9
KHOBAR, Saudi Arabia
--Shameem Babu @ iWesabe--

  

 iWesabe - ODOO ERP IMPLEMENTATION & CUSTOMIZATION SAUDI ARABIA.



For Queries : pks.shameem@gmail.com ,shameem@iwesabe.com

Activities     :    Youtube

                           Stackoverflow 

Experience

           iWesabe                                ◉

           Axon Communications        ❍

           Cybrosys Technologies        ❍


Shameem Babu @ iWesabe Saudi Arabia
2/9/17, 12:29 AM



Watch on YouTube : https://www.youtube.com/ How to add css file in odoo 10

Or simply you can use style attribute 

<p style="color:green;margin:0;font-weight:bold/* write your css instead of my example*/">
     Write something
<p>
0
ZetaMatic United States
6/10/19, 6:42 AM

Here is a Module that can help easily implement Custom CSS and Custom JS to Groups and Actions. 

https://www.odoo.com/apps/modules/11.0/custom_cssjs

0
Nicolas de Moreau Belgium
11/26/16, 1:13 AM

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

0
Dr Obx United Kingdom
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.

0
Vianney Adou Côte d'Ivoire
7/23/15, 6:54 AM

thank you Laurent Destailleur for answer.

It work for me !

0
Avatar

Pascal Tremblay Canada

--Pascal Tremblay--
1969
| 6 4 10
Amos, Canada
--Pascal Tremblay--


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

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

0
Rizo France
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

0
Mohammad Emami Iran
10/11/14, 2:46 AM

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

1 Comment
La Page PT, Pascal Tremblay Canada
12/26/14, 12:43 PM

still searching too!

Ask a Question
Writer
Tags
Keep Informed
5 follower(s)
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.

Register
Odoo Training Center

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

Test it now