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

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

Abonare

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

Această întrebare a fost marcată
kanbancolorsodoo12.0
1 Răspunde
14113 Vizualizări
Imagine profil
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
Imagine profil
Abandonează
Imagine profil
Jignesh Mehta
Cel mai bun răspuns

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
Imagine profil
Abandonează
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.

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