Se rendre au contenu
Odoo Menu
  • Se connecter
  • Essai gratuit
  • Applications
    Finance
    • Comptabilité
    • Facturation
    • Notes de frais
    • Feuilles de calcul (BI)
    • Documents
    • Signature
    Ventes
    • CRM
    • Ventes
    • PdV Boutique
    • PdV Restaurant
    • Abonnements
    • Location
    Sites web
    • Site Web
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Chaîne d'approvisionnement
    • Inventaire
    • Fabrication
    • PLM
    • Achats
    • Maintenance
    • Qualité
    Ressources Humaines
    • Employés
    • Recrutement
    • Congés
    • Évaluations
    • Recommandations
    • Parc automobile
    Marketing
    • Marketing Social
    • E-mail Marketing
    • SMS Marketing
    • Événements
    • Marketing Automation
    • Sondages
    Services
    • Projet
    • Feuilles de temps
    • Services sur Site
    • Assistance
    • Planification
    • Rendez-vous
    Productivité
    • Discussion
    • Intelligence artificielle
    • Internet des Objets
    • VoIP
    • Connaissances
    • WhatsApp
    Applications tierces Odoo Studio Plateforme Cloud d'Odoo
  • Industries
    Commerce de détail
    • Librairie
    • Magasin de vêtements
    • Magasin de meubles
    • Supermarché
    • Quincaillerie
    • Magasin de jouets
    Restauration & Hôtellerie
    • Bar et Pub
    • Restaurant
    • Fast-food
    • Maison d’hôtes
    • Distributeur de boissons
    • Hôtel
    Immobilier
    • Agence immobilière
    • Cabinet d'architecture
    • Construction
    • Gestion immobilière
    • Jardinage
    • Association de copropriétaires
    Consultance
    • Cabinet d'expertise comptable
    • Partenaire Odoo
    • Agence Marketing
    • Cabinet d'avocats
    • Aquisition de talents
    • Audit & Certification
    Fabrication
    • Textile
    • Métal
    • Meubles
    • Alimentation
    • Brasserie
    • Cadeaux d'entreprise
    Santé & Fitness
    • Club de sports
    • Opticien
    • Salle de fitness
    • Praticiens bien-être
    • Pharmacie
    • Salon de coiffure
    Commerce
    • Homme à tout faire
    • Matériel informatique & support
    • Systèmes photovoltaïques
    • Cordonnier
    • Services de nettoyage
    • Services CVC
    Autres
    • Organisation à but non lucratif
    • Agence environnementale
    • Location de panneaux d'affichage
    • Photographie
    • Leasing de vélos
    • Revendeur de logiciel
    Parcourir toutes les industries
  • Communauté
    Apprenez
    • Tutoriels
    • Documentation
    • Certifications
    • Formation
    • Blog
    • Podcast
    Renforcer l'éducation
    • Programme éducatif
    • Business Game Scale-Up!
    • Rendez-nous visite
    Obtenir le logiciel
    • Téléchargement
    • Comparez les éditions
    • Versions
    Collaborer
    • Github
    • Forum
    • Événements
    • Traductions
    • Devenir partenaire
    • Services pour partenaires
    • Enregistrer votre cabinet comptable
    Nos Services
    • Trouver un partenaire
    • Trouver un comptable
    • Rencontrer un conseiller
    • Services de mise en œuvre
    • Références clients
    • Assistance
    • Mises à niveau
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Obtenir une démonstration
  • Tarification
  • Aide
Vous devez être inscrit pour interagir avec la communauté.
Toutes les publications Personnes Badges
Étiquettes (Voir toutl)
odoo accounting v14 pos v15
À propos de ce forum
Vous devez être inscrit pour interagir avec la communauté.
Toutes les publications Personnes Badges
Étiquettes (Voir toutl)
odoo accounting v14 pos v15
À propos de ce forum
Aide

How can i decorate or customize badge widget using Odoo: Studio ONLY

S'inscrire

Recevez une notification lorsqu'il y a de l'activité sur ce poste

Cette question a été signalée
xmlstudio
1 Répondre
1388 Vues
Avatar
Happy Hoister Inc, Anton

Hi,


I created a selection field inside the form-view using Studio. 
Now, I added the field in list-view, and then I set the widget as a badge. But, no matter what the data is, it only shows the color grey. How can I customize the color based on what data are chosen and add a Font Awesome icon in the text? 


We are in Odoo Online, so we don't have access to backend.

0
Avatar
Ignorer
Avatar
Sujata
Meilleure réponse

Hi Anton, 

1️⃣ Why the badge is always grey & how to set colors dynamically

When you use a selection field with the badge widget in a list view, Odoo does not automatically color it based on the selected value.

If no color configuration is provided, the badge defaults to grey.

✅ Correct way to customize badge colors

To control badge colors, Odoo needs an integer field that represents the color index.

Steps (Studio-friendly approach)
  1. Selection field

    • Example:

      • Field name: x_status

      • Type: Selection

      • Values:

        • draft

        • confirmed

        • done

  2. Integer color field

    • Create another field:

      • Field name: x_status_color

      • Type: Integer

  3. List view configuration

    • Add the selection field to the list view

    • Set:

      • Widget → badge (or selection_badge)

      • Color Field → x_status_color

  4. Define color values

    • Odoo uses color indexes (same system used everywhere, like CRM stages)

    • Example:

      • Grey → 0

      • Green → 10

      • Blue → 4

      • Red → 1

      • Orange → 3

Example mapping
StatusColor field value
Draft0 (Grey)
Confirmed4 (Blue)
Done10 (Green)
Automating the color assignment

To avoid manual updates:

  • Use Automated Actions (Studio → Automation)

  • Trigger: On creation & update

  • Condition: based on the selection value

  • Action: set x_status_color accordingly

📌 Reference for better understanding: Check the Stage color field in the CRM pipeline — it uses the exact same concept.

2️⃣ Adding a Font Awesome icon inside the badge text

Odoo does not support Font Awesome icons inside selection labels (or badges) by default.

Selection values are treated as plain text, not HTML.

What can be done
  • There is no standard widget in Studio to inject Font Awesome icons into a badge

  • To achieve this, you would need:

    • A custom widget (JavaScript)

    • Or a custom QWeb view override

This requires development work, not achievable with Studio alone i guess. in case you find any solution let us know 

Possible workaround (limited)
  • Use emoji in the selection label (e.g. ✅ ❌ ⚠️)

  • Emojis are supported and render correctly in badges

2
Avatar
Ignorer
Vous appréciez la discussion ? Ne vous contentez pas de lire, rejoignez-nous !

Créez un compte dès aujourd'hui pour profiter de fonctionnalités exclusives et échanger avec notre formidable communauté !

S'inscrire
Publications associées Réponses Vues Activité
Studio changes create a big mess in XML Résolu
xml studio
Avatar
Avatar
1
mars 25
4435
How to activate XML Editor Résolu
xml studio
Avatar
Avatar
2
sept. 20
14155
Odoo 19 Enterprise - Customer address in invoice header
invoice xml studio
Avatar
Avatar
1
févr. 26
1233
readonly to a group and when the stage is in 2, 3, 4
xml studio odoo17
Avatar
Avatar
1
juin 24
3295
How to automatically assign sequence numbers to records in a Studio-created model ✅ SOLVED
studio
Avatar
0
juin 26
1300
Communauté
  • Tutoriels
  • Documentation
  • Forum
Open Source
  • Téléchargement
  • Github
  • Runbot
  • Traductions
Services
  • Hébergement Odoo.sh
  • Assistance
  • Migration
  • Développements personnalisés
  • Éducation
  • Trouver un comptable
  • Trouver un partenaire
  • Devenir partenaire
À propos
  • Notre société
  • Actifs de la marque
  • Contactez-nous
  • Emplois
  • Événements
  • Podcast
  • Blog
  • Clients
  • Informations légales • Confidentialité
  • Sécurité.
الْعَرَبيّة 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 Svenska ภาษาไทย Türkçe українська Tiếng Việt

Odoo est une suite d'applications open source couvrant tous les besoins de votre entreprise : CRM, eCommerce, Comptabilité, Inventaire, Point de Vente, Gestion de Projet, etc.

Le positionnement unique d'Odoo est d'être à la fois très facile à utiliser et totalement intégré.

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