Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
2 Odpowiedzi
16995 Widoki

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

Awatar
Odrzuć

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

Najlepsza odpowiedź

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.

Awatar
Odrzuć

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.

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

Najlepsza odpowiedź

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

Awatar
Odrzuć

please give an example

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

Powiązane posty Odpowiedzi Widoki Czynność
0
maj 23
2762
2
maj 21
7014
1
sie 17
7450
2
cze 15
17187
3
lis 21
6157