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

Set color for field in kanban view. How to do that?

Suscribirse

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

Se marcó esta pregunta
kanbancolorsodoo12.0
1 Responder
14124 Vistas
Avatar
Paulo Matos

Hello everyone,

I have a simple kanban view on Odoo 12 and I need to change the color of a specific field shown on kanban based on another field value on the same model.

In fact, I don't even know how to change kanban colors for both fields and background.

On my model I have:

odometer = fields.Integer('Odometer Control')
limit_reached= fields.Boolean('Limit reached')

Both fields are shown on kanban view on the xml for the model and I need to change the "odometer" field color to red, if the "limit_reached" value is true.

Alternatively, I can also change the full background color if "limit_reached" is true.

How can I achieve that on Odoo 12?

Thank you in advance

Regards

0
Avatar
Descartar
Avatar
Jignesh Mehta
Mejor respuesta

Hello Paulo Matos,

Here is the example, In that if limit_reached is true then color will be changed to green.

Example :-

<record id="kanban_view" model="ir.ui.view">
    <field name="name">model.model.kanban.view</field>
    <field name="model">model.model</field>
    <field name="arch" type="xml">
        <kanban class="o_kanban_small_column" create="false">
            <field name="limit_reached"/>
            <field name="name"/>
            <templates>
                <t t-name="kanban-box">
                    <div t-attf-class="oe_kanban_color_#{record.limit_reached.raw_value} oe_kanban_card oe_kanban_global_click">
                        <div class="oe_kanban_content">
                            <strong><field name="name"/></strong>
                        </div>
                    </div>
                </t>
            </templates>
        </kanban>
    </field>
</record>

Hope it will works for you.

Thanks,

0
Avatar
Descartar
Paulo Matos
Autor

Thank you very much @Jignesh Mehta

I have tried the code but I am having an "Expected Singleton" error.

Perhaps this is because the field "limit_reached" is obtained by a compute function and has the store value set to False.

I can try another solution that is comparing two values from 2 integer fields.

In this case, I have on my form 2 values:

- km = fields.Integer('KM')

- odometro = fields.Integer('Odometer')

Can you please help me change the above code to compare if "odometer" is bigger than "km"?

Thank you once again

Jignesh Mehta

Hello, When "Expected Singleton" occurs, you have to use loop in code. Try to add loop before line and then restart server.

¿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 12 kanban attribute default_group_by is not working
kanban odoo12.0
Avatar
1
dic 20
3167
Add Color in kanban view
views date kanban colors
Avatar
Avatar
Avatar
2
mar 24
9099
Background Color depends on a field
python xml colors odoo12.0
Avatar
Avatar
1
sept 22
8134
Odoo[12.0]: How to show kanban particular stage's data into the custom created module.
kanban stage custommodule odoo12.0
Avatar
0
nov 19
37
Odoo[12]: How to open form when we moving the Kanban Stage one to another.
stages kanban formview odoo12.0
Avatar
Avatar
Avatar
3
oct 19
5272
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.

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