I know we can set text to be center as below code:
text-align:center;
what about for float number?
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
I know we can set text to be center as below code:
text-align:center;
what about for float number?
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"
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.
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
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()".
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.
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign up