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.

2

Right align labels in tree view (V7) for some fields(numeric fields)

By
Kevin McMenamin
on 5/29/13, 5:43 PM 5,033 views

Is there a way to set labels for numeric fields to be right aligned?

Hello Kevin , you get any solution ? I want that all labels of tree-view will be right aligned too. Thanks to answer

laribi
on 9/2/13, 8:03 AM
1

Prakash

--Prakash--
3173
| 5 4 7
Bikaner, India
--Prakash--

OpenERP Devloper at SunARC Technology

Prakash
On 1/16/14, 5:32 AM

In custom module create your CSS file, and put it in the standard place : module/static/src/css/allign.css and then add to the list of css files to load in __openerp__.py : css:['static/src/css/allign.css']

The below code for right align data in tree view:-

In allign.css add the below line:-

.openerp .rallign {
  text-align: right;
}

In xml file add the below line:-

<tree string="Product" version="7.0">
    <field name="total" class="rallign"/>
</tree>

For right align labels the default base css base/static/src/css/allign.css Line:2928

.openerp .oe_list_content th.oe_sortable, .openerp .oe_list_content th.oe_sortable div {
    cursor: pointer;
    text-align: right; /* added this line */
}

The above right align Label all the modules. No idea about particular field Label in tree view.

I tried this, but it isn't working for me. I confirmed the "rallign" css class is loaded, but it doesn't get applied to the header nor field in the generated HTML.

Daniel Reis
on 3/12/14, 1:12 PM

Please make sure tree view included version="7.0" then only its works. please apply the changes using plugin --> inspect Element with Firebug and then add the above code in custom module

Prakash
on 3/13/14, 2:07 AM
0
voathnak lim
On 7/9/13, 7:13 AM

you could add class on it in the xml view. and add the css in static.

please give an example

Omal Bastin
on 11/4/13, 10:25 AM

I am not able to use class attribute in tree view.

Vaibhav
on 1/9/14, 2:18 AM

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: 5/29/13, 5:43 PM
Seen: 5033 times
Last updated: 3/16/15, 8:10 AM