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.

0

How to add one class into button

By
Đặng Danh Thông
on 11/2/15, 7:11 PM 427 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,

0

Akhil P Sivan

--Akhil P Sivan--
3423
| 5 3 6
Kochi, India
--Akhil P Sivan--

Interested in exploring Odoo both technically & functionality wise.

email-id : akhilpsivan01@gmail.com

Akhil P Sivan
On 11/3/15, 1:29 AM

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.

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

1 follower(s)

Stats

Asked: 11/2/15, 7:11 PM
Seen: 427 times
Last updated: 11/3/15, 1:29 AM