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 set numbers in "tree" to be center?

By
vx2008
on 7/25/16, 9:09 AM 233 views

I know we can set text to be center as below code:

text-align:center;

what about for float number?

1
OpenGest.Solutions
On 7/25/16, 12:30 PM

You can add an extra class to the div that olds the tree table:

 

<tree string="Sales Orders" decoration-bf="message_needaction==True" decoration-muted="state=='cancel'" class="my_class">


this exemple comes from the default sale module:

http://gitlab.opengest.solutions/opengest/odoo/blob/master/addons/sale/sale_view.xml#L114


As you can see, I've just added class="my_class"


In the same module, the sale's one, you can find an exemple how to insert custom CSS:

http://gitlab.opengest.solutions/opengest/odoo/blob/master/addons/sale/views/sale.xml


The css file:

http://gitlab.opengest.solutions/opengest/odoo/blob/master/addons/sale/static/src/css/sale.css




Then, just add your custom css file.

I have tried as your explanation; but it seems to not work;

shall I know what is the meaning of "decoration-bf" and "decoration-muted"

vx2008
on 7/26/16, 12:32 AM

decoration-bf: marks the record in bold font, decoration-muted: will mark it in gray, similarly there are quiet a few, basically they are used to indicate a quick status at glance.

deep
on 7/26/16, 2:17 AM

I have changed my answer:

this exemple comes from the default sale module:

http://gitlab.opengest.solutions/opengest/odoo/blob/master/addons/sale/sale_view.xml#L114

As you can see, I've just added class="my_class"

In the same module, the sale's one, you can find an exemple how to insert custom CSS:

http://gitlab.opengest.solutions/opengest/odoo/blob/master/addons/sale/views/sale.xml

The css file:

http://gitlab.opengest.solutions/opengest/odoo/blob/master/addons/sale/static/src/css/sale.css

OpenGest.Solutions
on 7/26/16, 12:55 PM

Thank you for you detail showing;

I have test this; and I find the css file can work even if delete "class="my_class" ", and I don;t know why you add this?

in addition, I want to the context in "xml" to be center when I use "text-align: center" in "css" file; and I find that the code can only make "fieds.Char" to be center rather than "fields.Float()".

vx2008
on 7/26/16, 6:55 PM
1
reda rouichi
On 7/25/16, 11:24 AM

Take a look here (https://www.odoo.com/es_ES/forum/ayuda-1/question/changing-column-widths-tree-view-35981), It looks like you have the same problem.

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: 7/25/16, 9:09 AM
Seen: 233 times
Last updated: 7/29/16, 7:31 PM