Skip to Content
Odoo Meniu
  • Autentificare
  • Try it free
  • Aplicații
    Finanțe
    • Contabilitate
    • Facturare
    • Cheltuieli
    • Spreadsheet (BI)
    • Documente
    • Semn
    Vânzări
    • CRM
    • Vânzări
    • POS Shop
    • POS Restaurant
    • Abonamente
    • Închiriere
    Site-uri web
    • Constructor de site-uri
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Lanț Aprovizionare
    • Inventar
    • Producție
    • PLM
    • Achiziție
    • Maintenance
    • Calitate
    Resurse Umane
    • Angajați
    • Recrutare
    • Time Off
    • Evaluări
    • Referințe
    • Flotă
    Marketing
    • Social Marketing
    • Marketing prin email
    • SMS Marketing
    • Evenimente
    • Automatizare marketing
    • Sondaje
    Servicii
    • Proiect
    • Foi de pontaj
    • Servicii de teren
    • Centru de asistență
    • Planificare
    • Programări
    Productivitate
    • Discuss
    • Aprobări
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    Aplicații Terțe Odoo Studio Platforma Odoo Cloud
  • Industrii
    Retail
    • Book Store
    • Magazin de îmbrăcăminte
    • Magazin de Mobilă
    • Magazin alimentar
    • Magazin de materiale de construcții
    • Magazin de jucării
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Distribuitor de băuturi
    • Hotel
    Proprietate imobiliara
    • Real Estate Agency
    • Firmă de Arhitectură
    • Construcție
    • Estate Managament
    • Grădinărit
    • Asociația Proprietarilor de Proprietăți
    Consultanta
    • Firma de Contabilitate
    • Partener Odoo
    • Agenție de marketing
    • Law firm
    • Atragere de talente
    • Audit & Certification
    Producție
    • Textil
    • Metal
    • Mobilier
    • Mâncare
    • Brewery
    • Cadouri corporate
    Health & Fitness
    • Club Sportiv
    • Magazin de ochelari
    • Centru de Fitness
    • Wellness Practitioners
    • Farmacie
    • Salon de coafură
    Trades
    • Handyman
    • IT Hardware and Support
    • Asigurare socială de stat
    • Cizmar
    • Servicii de curățenie
    • HVAC Services
    Altele
    • Organizație nonprofit
    • Agenție de Mediu
    • Închiriere panouri publicitare
    • Fotografie
    • Închiriere biciclete
    • Asigurare socială
    Browse all Industries
  • Comunitate
    Învăță
    • Tutorials
    • Documentație
    • Certificări
    • Instruire
    • Blog
    • Podcast
    Empower Education
    • Program Educațional
    • Scale Up! Business Game
    • Visit Odoo
    Obține Software-ul
    • Descărcare
    • Compară Edițiile
    • Lansări
    Colaborați
    • Github
    • Forum
    • Evenimente
    • Translations
    • Devino Partener
    • Services for Partners
    • Înregistrează-ți Firma de Contabilitate
    Obține Servicii
    • Găsește un Partener
    • Găsiți un contabil
    • Meet an advisor
    • Servicii de Implementare
    • Referințe ale clienților
    • Suport
    • Actualizări
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Obține un demo
  • Prețuri
  • Ajutor

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

  • CRM
  • e-Commerce
  • Contabilitate
  • Inventar
  • PoS
  • Proiect
  • MRP
All apps
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
All Posts Oameni Insigne
Etichete (View all)
odoo accounting v14 pos v15
Despre acest forum
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
All Posts Oameni Insigne
Etichete (View all)
odoo accounting v14 pos v15
Despre acest forum
Suport

Fields defined as char take up way to much space in list view

Abonare

Primiți o notificare când există activitate la acestă postare

Această întrebare a fost marcată
development
4 Răspunsuri
2885 Vizualizări
Imagine profil
Blerton Ismaili

I've been following the written tutorial, and I am currently at Chapter 6: Basic Views.

The next step was to create the following list view (tried to upload image, couldn't), and I got everything to work except the Title and Postcode (both char fields) take up almost all of the width, and the columns don't equally divide the width.

I looked for ways to make this work, but the only "decent" solution was to set the width to a fixed amount in pixels.


My question would be, how did the guide achieve making all columns take up equal space.


Thank you for your time :)

1
Imagine profil
Abandonează
Imagine profil
Andry Ang
Cel mai bun răspuns

Hi Blerton,


Edit: 

I see you mentioned list. My bad haha.

What you do is already on the right track by adjusting the "width" attribute. But, as you need to know that odoo's table is auto adjusted to fit the contents. If you have a very long title and very short postcode, it will auto adjust to try to fit it as "fair" as possible. Check the reference here


If you really insist to change the width. It might be too "forcing" and I afraid mess up other columns size. You can dive into the css or js files in the web module to know what's the width for each field types.


Hope this helps.


Previous reply:

I assume you are referring to this. It would be best if you could share your current code so we can work from there.


I would suggest you to follow this code as reference only and I only write the starting from the <form> tag only

<form string="Property Form">

<sheet>

<div class="oe_title">

<label for="name"/> <!-- This is the label for the name field: optional -->

<h1><field name="name" class="oe_inline"/></h1>

</div>

<group>

<group>

<field name="postcode"/>

<field name="available_from"/>

</group>

<group>

<field name="expected_price"/>

<field name="selling_price"/>

</group>

</group>

<!-- This is a notebook with description page: I skip this -->

<notebook></notebook>

</sheet>

</form>

Hope this helps.

1
Imagine profil
Abandonează
Imagine profil
Christoph Farnleitner
Cel mai bun răspuns

https://www.odoo.com/documentation/18.0/developer/tutorials/server_framework_101/06_basicviews.html#list

Just so we're talking about the same thing here: the columns shown in the tutorial have never been equally sized nor equally spaced to begin with.


Given a small enough view port, any list will look 'almost equally spaced' if enough columns are there.

Apart from that the width-attribute is correct. Else you would need to add a class to the list and create a stylesheet specific to it (which I wouldn't suggest you to do just for the sake of column widths unless the nature of the data in that list explicitly require it).

0
Imagine profil
Abandonează
Imagine profil
Ariko Stephen Philemon
Cel mai bun răspuns

Ran into the same isuue. Getting results different from those expected by the tutorial is a huge bad learning experience. If the tutorial intended to delay explanations on column width customization, the tutorial should have explicitly stated this.

0
Imagine profil
Abandonează
Imagine profil
Blerton Ismaili
Autor Cel mai bun răspuns

This was described as the form view, what I meant is the list view, where you can see all record and choose a single record to view. (I would post a picture but I dont have enough karma).

<record id="estate_property_view_list" model="ir.ui.view">
<field name="name">estate.property.view.list</field>
<field name="model">estate.property</field>
<field name="arch" type="xml">
<list string="Properties">
<field name="title" width="150px"/>
<field name="postcode" width="50px"/>
<field name="bedrooms"/>
<field name="living_area"/>
<field name="expected_price"/>
<field name="selling_price"/>
<field name="date_availability"/>
</list>
</field>
</record>


This is the code I'm using, where I use the width attribute to kind-of fix this issue (but if there were texts longer than this they wont be entirely visible), but isn't there any better way to make it only take up as much space as it needs.

What I want is each column to take the same amount of space, these char fields mess things up.


Thanks for your time


Edit: I somehow messed this up, didn't know I had to comment your response .-.

0
Imagine profil
Abandonează
Blerton Ismaili
Autor

"But, as you need to know that odoo's table is auto adjusted to fit the contents." - This is the part that I find confusing since it doesn't seem to do that for me.

The width is *WAY* bigger than the content, meaning the width isn't correctly adjusting to the content.

In my case the title takes like 40% of the screen, same for the postcode, and then all the other fields are crammed into the rest of the screen. (If i dont specify the width my self)

Any idea why that might be happening?

In the meantime manually setting the width will have to do I guess

Enjoying the discussion? Don't just read, join in!

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

Înscrie-te
Related Posts Răspunsuri Vizualizări Activitate
Odoo 17: How to Create a Custom Table Header in List (Tree) View Using OWL
development
Imagine profil
0
dec. 25
105
How to create custom Table header by using odoo 17
development
Imagine profil
Imagine profil
1
dec. 25
334
Oddo Integration with Intune
development
Imagine profil
0
dec. 25
1748
@guia@¿Cómo hablar con una persona en Air France?
development
Imagine profil
0
dec. 25
2
How do I change the name of the module, or rather the name assigned to the module, after I created it in Odoo Studio?
development
Imagine profil
Imagine profil
1
dec. 25
558
Comunitate
  • Tutorials
  • Documentație
  • Forum
Open Source
  • Descărcare
  • Github
  • Runbot
  • Translations
Servicii
  • Hosting Odoo.sh
  • Suport
  • Actualizare
  • Custom Developments
  • Educație
  • Găsiți un contabil
  • Găsește un Partener
  • Devino Partener
Despre Noi
  • Compania noastră
  • Active de marcă
  • Contactați-ne
  • Locuri de muncă
  • Evenimente
  • Podcast
  • Blog
  • Clienți
  • Aspecte juridice • Confidențialitate
  • Securitate
الْعَرَبيّة 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 este o suită de aplicații de afaceri open source care acoperă toate nevoile companiei dvs.: CRM, comerț electronic, contabilitate, inventar, punct de vânzare, management de proiect etc.

Propunerea de valoare unică a Odoo este să fie în același timp foarte ușor de utilizat și complet integrat.

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