Odoo Help


XML Validation Error when adding Class to Field

Michael Thomas
on 1/6/15, 10:52 AM 1,650 views

I am trying to add a css class to a column in a tree view so I can adjust the columns and prevent page overflow. After doing some research, I determined that I needed to do one of the following:

<tree string="Products" class="myclass">


<field name="name" class="myclass">

Both of these are causing XML validation errors in the openerp console and, presumably, would do the same if I made a custom module. How can I set the class on a column in a tree view so that I can apply some custom css to it?

Michael Thomas
On 1/6/15, 11:01 AM

Got it!. The cause for the validation errors was that I did not have a version attribute in my tree declaration, like so:

<tree string="Products" version="7.0" class="x-portal">

Now that I added the version, I am able to define a class. I have not yet tested if this correctly is assigning the css class and applying my style, but it does get past the XML validation error. 


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

1 follower(s)


Asked: 1/6/15, 10:52 AM
Seen: 1650 times
Last updated: 3/16/15, 8:10 AM