Ir al contenido
Odoo Menú
  • Iniciar sesión
  • Pruébalo gratis
  • Aplicaciones
    Finanzas
    • Contabilidad
    • Facturación
    • Gastos
    • Hoja de cálculo (BI)
    • Documentos
    • Firma electrónica
    Ventas
    • CRM
    • Ventas
    • PdV para tiendas
    • PdV para restaurantes
    • Suscripciones
    • Alquiler
    Sitios web
    • Creador de sitios web
    • Comercio electrónico
    • Blog
    • Foro
    • Chat en vivo
    • eLearning
    Cadena de suministro
    • Inventario
    • Manufactura
    • PLM
    • Compras
    • Mantenimiento
    • Calidad
    Recursos humanos
    • Empleados
    • Reclutamiento
    • Vacaciones
    • Evaluaciones
    • Referencias
    • Flotilla
    Marketing
    • Redes sociales
    • Marketing por correo
    • Marketing por SMS
    • Eventos
    • Automatización de marketing
    • Encuestas
    Servicios
    • Proyectos
    • Registro de horas
    • Servicio externo
    • Soporte al cliente
    • Planeación
    • Citas
    Productividad
    • Conversaciones
    • Aprobaciones
    • IoT
    • VoIP
    • Artículos
    • WhatsApp
    Aplicaciones externas Studio de Odoo Plataforma de Odoo en la nube
  • Industrias
    Venta minorista
    • Librería
    • Tienda de ropa
    • Mueblería
    • Tienda de abarrotes
    • Ferretería
    • Juguetería
    Alimentos y hospitalidad
    • Bar y pub
    • Restaurante
    • Comida rápida
    • Casa de huéspedes
    • Distribuidora de bebidas
    • Hotel
    Bienes inmuebles
    • Agencia inmobiliaria
    • Estudio de arquitectura
    • Construcción
    • Gestión de bienes inmuebles
    • Jardinería
    • Asociación de propietarios
    Consultoría
    • Firma contable
    • Partner de Odoo
    • Agencia de marketing
    • Bufete de abogados
    • Adquisición de talentos
    • Auditorías y certificaciones
    Manufactura
    • Textil
    • Metal
    • Muebles
    • Comida
    • Cervecería
    • Regalos corporativos
    Salud y ejercicio
    • Club deportivo
    • Óptica
    • Gimnasio
    • Especialistas en bienestar
    • Farmacia
    • Peluquería
    Trades
    • Personal de mantenimiento
    • Hardware y soporte de TI
    • Sistemas de energía solar
    • Zapateros y fabricantes de calzado
    • Servicios de limpieza
    • Servicios de calefacción, ventilación y aire acondicionado
    Otros
    • Organización sin fines de lucro
    • Agencia para la protección del medio ambiente
    • Alquiler de anuncios publicitarios
    • Fotografía
    • Alquiler de bicicletas
    • Distribuidor de software
    Descubre todas las industrias
  • Odoo Community
    Aprende
    • Tutoriales
    • Documentación
    • Certificaciones
    • Capacitación
    • Blog
    • Podcast
    Fortalece la educación
    • Programa educativo
    • Scale Up! El juego empresarial
    • Visita Odoo
    Obtén el software
    • Descargar
    • Compara ediciones
    • Versiones
    Colabora
    • GitHub
    • Foro
    • Eventos
    • Traducciones
    • Conviértete en partner
    • Servicios para partners
    • Registra tu firma contable
    Obtén servicios
    • Encuentra un partner
    • Encuentra un contador
    • Contacta a un consultor
    • Servicios de implementación
    • Referencias de clientes
    • Soporte
    • Actualizaciones
    GitHub YouTube Twitter LinkedIn Instagram Facebook Spotify
    +1 (650) 691-3277
    Solicita una demostración
  • Precios
  • Ayuda

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

  • CRM
  • e-Commerce
  • Contabilidad
  • Inventario
  • PoS
  • Proyectos
  • MRP
All apps
Debe estar registrado para interactuar con la comunidad.
Todas las publicaciones Personas Insignias
Etiquetas (Ver todo)
odoo accounting v14 pos v15
Acerca de este foro
Debe estar registrado para interactuar con la comunidad.
Todas las publicaciones Personas Insignias
Etiquetas (Ver todo)
odoo accounting v14 pos v15
Acerca de este foro
Ayuda

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

Suscribirse

Reciba una notificación cuando haya actividad en esta publicación

Se marcó esta pregunta
development
4 Respuestas
2889 Vistas
Avatar
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
Avatar
Descartar
Avatar
Andry Ang
Mejor respuesta

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
Avatar
Descartar
Avatar
Christoph Farnleitner
Mejor respuesta

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
Avatar
Descartar
Avatar
Ariko Stephen Philemon
Mejor respuesta

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
Avatar
Descartar
Avatar
Blerton Ismaili
Autor Mejor respuesta

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
Avatar
Descartar
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

¿Le interesa esta conversación? ¡Participe en ella!

Cree una cuenta para poder utilizar funciones exclusivas e interactuar con la comunidad.

Registrarse
Publicaciones relacionadas Respuestas Vistas Actividad
Odoo 17: How to Create a Custom Table Header in List (Tree) View Using OWL
development
Avatar
0
dic 25
109
How to create custom Table header by using odoo 17
development
Avatar
Avatar
1
dic 25
338
Oddo Integration with Intune
development
Avatar
0
dic 25
1750
@guia@¿Cómo hablar con una persona en Air France?
development
Avatar
0
dic 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
Avatar
Avatar
1
dic 25
559
Comunidad
  • Tutoriales
  • Documentación
  • Foro
Código abierto
  • Descargar
  • GitHub
  • Runbot
  • Traducciones
Servicios
  • Alojamiento en Odoo.sh
  • Soporte
  • Actualizaciones del software
  • Desarrollos personalizados
  • Educación
  • Encuentra un contador
  • Encuentra un partner
  • Conviértete en partner
Sobre nosotros
  • Nuestra empresa
  • Activos de marca
  • Contáctanos
  • Empleos
  • Eventos
  • Podcast
  • Blog
  • Clientes
  • Legal • Privacidad
  • Seguridad
الْعَرَبيّة 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 es un conjunto de aplicaciones de código abierto que cubren todas las necesidades de tu empresa: CRM, comercio electrónico, contabilidad, inventario, punto de venta, gestión de proyectos, etc.

La propuesta única de valor de Odoo es ser muy fácil de usar y estar totalmente integrado.

Sitio web hecho con

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