Skip to Content
Odoo Menu
  • Prihlásiť sa
  • Vyskúšajte zadarmo
  • Aplikácie
    Financie
    • Účtovníctvo
    • Fakturácia
    • Výdavky
    • Tabuľka (BI)
    • Dokumenty
    • Podpis
    Predaj
    • CRM
    • Predaj
    • POS Shop
    • POS Restaurant
    • Manažment odberu
    • Požičovňa
    Webstránky
    • Tvorca webstránok
    • eShop
    • Blog
    • Fórum
    • Živý chat
    • eLearning
    Supply Chain
    • Sklad
    • Výroba
    • Správa životného cyklu produktu
    • Nákup
    • Údržba
    • Manažment kvality
    Ľudské zdroje
    • Zamestnanci
    • Nábor zamestnancov
    • Voľné dni
    • Hodnotenia
    • Odporúčania
    • Vozový park
    Marketing
    • Marketing sociálnych sietí
    • Email marketing
    • SMS marketing
    • Eventy
    • Marketingová automatizácia
    • Prieskumy
    Služby
    • Projektové riadenie
    • Pracovné výkazy
    • Práca v teréne
    • Helpdesk
    • Plánovanie
    • Schôdzky
    Produktivita
    • Tímová komunikácia
    • Schvalovania
    • IoT
    • VoIP
    • Znalosti
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Priemyselné odvetvia
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Reštaurácia
    • Fast Food
    • Guest House
    • Beverage distributor
    • Hotel
    Reality
    • Real Estate Agency
    • Architecture Firm
    • Konštrukcia
    • Estate Managament
    • Gardening
    • Property Owner Association
    Poradenstvo
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Výroba
    • Textile
    • Metal
    • Furnitures
    • Jedlo
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware and Support
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Iní
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all Industries
  • Komunita
    Vzdelávanie
    • Tutoriály
    • Dokumentácia
    • Certifikácie
    • Školenie
    • Blog
    • Podcast
    Empower Education
    • Vzdelávací program
    • Scale Up! Business Game
    • Visit Odoo
    Softvér
    • Stiahnuť
    • Porovnanie Community a Enterprise vierzie
    • Releases
    Spolupráca
    • Github
    • Fórum
    • Eventy
    • Preklady
    • Staň sa partnerom
    • Services for Partners
    • Register your Accounting Firm
    Služby
    • Nájdite partnera
    • Nájdite účtovníka
    • Meet an advisor
    • Implementation Services
    • Zákaznícke referencie
    • Podpora
    • Upgrades
    ​Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Získajte demo
  • Cenník
  • Pomoc

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Účtovníctvo
  • Sklady
  • PoS
  • Projektové riadenie
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Tagy (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Tagy (View all)
odoo accounting v14 pos v15
About this forum
Pomoc

how to change text align for a float/integer field collum heading in tree view in odoo 16

Odoberať

Get notified when there's activity on this post

This question has been flagged
treeviewformnumberalignmentodoo16features
2 Replies
5456 Zobrazenia
Avatar
dmashraf

usually collum heading in tree view for numeric_field is alligned right, But I want to change it to left/center. 

1
Avatar
Zrušiť
Avatar
Salman Bam
Best Answer

I wasted so much time on problems like this but finally... Today I can say that I've found the solution for any similar problem related to default styles being stubborn.
 
I will show you step-by-step guide on  how I solved it (Because the classes used may differ overtime, but the solution method will hopefully stay the same).

How I Solved It:

Brief Explanation:
1- Inspect the desired field using the developer tool of your browser.
2- Identify the class that is changing the alignment (or any other style) of your field.
3- Reference that class in your css file or xml style tag.
4- Add your desired style for that class.
5- Celebrate.

Detailed Explanation:
1 - Right click on the header of the element that you want to change its alignment (or any other default style). 
1.1- Click inspect.

alternative way: (You don't have to follow these steps if you understand the first step)
1.1- Click the three dots on the right upper corner of your browser (I'm using Chrome)
1.2- Select "More Tools" --> "Developer Tools"
1.3- Enable the inspect from the right upper corner of the panel (or use CTRL+SHIFT+C)
1.4- Left Click on the element that you want to change the alignment of.

2.1- Now locate the styles tab (It should be on the right upper corner... I think :))

2.2- You should see all the classes and their styles for the element that you clicked on. Look for the class that has the style you wish to change (for my case any class that adds a "text-align: right") because I want to align my element to the left.

2.2.1 - I found this class:
.text-end {

text-align: right !important;

} 

3.1- Now you can reference the same class in an external CSS file or in your XML using the style tag (I did the XML one, because I am lazy)

3.2- XML code:










Hope you guys find my explanation helpful! 

Edit: This method works with the headers and the fields themselves.
- If you want to change the header then inspect the header and look for the desired class/classes.
- If you want to change the field then inspect the field itself and look for the desired class/classes.

0
Avatar
Zrušiť
Salman Bam

This is the xml code: (It's bugged on the main answer for some reason)
<style>
.text-end {
text-align: left !important;
}
</style>
<field name="current_category_ids" invisible="1"/>
<field name="unique_category_ids" widget="one2many_list">
<tree class="custom-class" editable="bottom">
<field name="category"/>
<field name="commission_weight"/>
</tree>
</field>

Avatar
imad chaikhi
Best Answer

@dmashraf.
For this you need to create css file when you defin how you want to allign the text something like:

.o_list_view .o_list_table thead > tr > th:not(.o_list_record_selector).o_list_number_th {
    text-align: center;
}
.o_list_view .o_list_table tbody > tr > td:not(.o_list_record_selector).o_list_number {
    text-align: center;
}  

You can find the code of the list view css in this file:
addons\web\static\src\views\list\list_renderer.scss

This link may help you:
https://learnopenerp.blogspot.com/2016/04/how-to-align-left-odoo-fields-float.html

0
Avatar
Zrušiť
Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Registrácia
Related Posts Replies Zobrazenia Aktivita
how to change text align for a float/integer field in tree view in odoo 16 Solved
treeview float alignment numeric_field odoo16features
Avatar
Avatar
Avatar
Avatar
3
júl 25
3294
How to override FormController method?
form odoo16features
Avatar
Avatar
1
apr 24
3497
How To Reset Dynamic Tree View To Its Default Visible State After User Modifies in Odoo 16?
treeview odoo16features
Avatar
0
dec 23
2535
button tree view?
treeview odoo16features
Avatar
Avatar
Avatar
2
aug 23
4772
Button in all modules
form odoo16features
Avatar
Avatar
Avatar
3
jún 23
3292
Komunita
  • Tutoriály
  • Dokumentácia
  • Fórum
Open Source
  • Stiahnuť
  • Github
  • Runbot
  • Preklady
Služby
  • Odoo.sh hosting
  • Podpora
  • Vyššia verzia
  • Custom Developments
  • Vzdelávanie
  • Nájdite účtovníka
  • Nájdite partnera
  • Staň sa partnerom
O nás
  • Naša spoločnosť
  • Majetok značky
  • Kontaktujte nás
  • Pracovné ponuky
  • Eventy
  • Podcast
  • Blog
  • Zákazníci
  • Právne dokumenty • Súkromie
  • Bezpečnosť
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo je sada podnikových aplikácií s otvoreným zdrojovým kódom, ktoré pokrývajú všetky potreby vašej spoločnosti: CRM, e-shop, účtovníctvo, skladové hospodárstvo, miesto predaja, projektový manažment atď.

Odoo prináša vysokú pridanú hodnotu v jednoduchom použití a súčasne plne integrovanými biznis aplikáciami.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now