This question has been flagged
1 Reply
13757 Views

Hi,

I want to add external css file into odoo v8. My css change style of button. 

How to change:

<button type="button" class="oe_button oe_form_button oe_highlight">...</button>

by 

<button type="button" class="oe_button oe_form_button oe_highlight new_class">...</button>

Impossible if i want to add class into all button of odoo

Thank,

Avatar
Discard
Best Answer

Hi,

You can create your custom css file under:

your_module >> static >> src >> css >>my_css.css


You can then define your class in the my_css.css file. For eg:

.openerp .your_custom_button {
font-weight: normal;
width: 132px !important;
height: 40px;
color: #666;
margin: 0px -1px -1px 0px;
padding: 0;
border: 1px solid #dddddd;
border-radius: 0;
box-shadow: none;
background: white;
}

To include your css file, add the following in templates.xml file.

<template id="assets_backend" name="test_module assets" inherit_id="web.assets_backend">

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

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

        </xpath>

</template>

Then you can use class ="your_custom_class" attribute in your button definition in xml file.

Avatar
Discard