Odoo Help


How to change the css text-align property for column in a tree view?

on 10/26/15, 6:20 PM 2,533 views

What is the right way to change the text-align property for a column in a tree view.  

I have a custom css file in the static/src/css directory.  

I also have it registered in the __openerp__.py file in the 'css': [ 'static/src/css/custom_style.css' ].  

I also made sure the field in the xml file had the right class name set like class="change_text_align"

For some reason though, it will not change the text-align for the column for the field in the tree view.  Is there anything that I am missing?  I just want to align the text on the left side of the column instead of the right.

I also tried adding a style attribute to the field like this, but it still didnt work:

         <field name="my_field" style="text-align: left" /> 

texts are aligned at the left side anyway, you have nothing to change. Probably you mean numbers?

on 10/27/15, 8:16 AM



| 6 5 7
Tbilisi, Georgia
On 10/27/15, 8:35 AM

quote from question:

I just want to align the text on the left side of the column instead of the right.

NOTE: text is aligned at the left side anyway (fields of type char or text), so question is not correctly describes the problem and requires further clarification.

Perhaps, if question is about numeric (integer or float) fields (as numeric fields are aligned at the right side), then it's possible to align them to the left side like text fields, using type="char" attribute in xml record:

<field name="my_numeric_field" type="char" />

if we use this way, then we do not need additional css for this purpose.

on 10/27/15, 8:40 AM

Thank you so much! That did the trick.

on 10/27/15, 11:23 AM

Hi Temur, I want my Integer/float field aligned at Centre, can you please help me out ?

on 9/6/17, 2:25 AM

one thing more i am having a widget already in my field for regex. so in that case i am not able to use any other widget in same field.

on 9/6/17, 2:27 AM

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.


Odoo Training Center

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

Test it now

Question tools

2 follower(s)


Asked: 10/26/15, 6:20 PM
Seen: 2533 times
Last updated: 9/6/17, 3:28 AM