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
    • Validations
    • 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
    • Épicerie
    • Quincaillerie
    • Magasin de jouets
    Food & Hospitality
    • Bar et Pub
    • Restaurant
    • Fast-food
    • Guest House
    • Distributeur de boissons
    • Hotel
    Real Estate
    • Real Estate Agency
    • Cabinet d'architecture
    • Construction
    • Gestion immobilière
    • Jardinage
    • Association de copropriétaires
    Consulting
    • Accounting Firm
    • Partenaire Odoo
    • Agence Marketing
    • Cabinet d'avocats
    • Aquisition de talents
    • Audit & Certification
    Fabrication
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Cadeaux d'entreprise
    Santé & Fitness
    • Club de sports
    • Opticien
    • Salle de fitness
    • Praticiens bien-être
    • Pharmacie
    • Salon de coiffure
    Trades
    • Bricoleur
    • Matériel informatique et support
    • Solar Energy Systems
    • Cordonnier
    • Services de nettoyage
    • HVAC Services
    Others
    • Nonprofit Organization
    • Agence environnementale
    • Location de panneaux d'affichage
    • Photographie
    • Leasing de vélos
    • Revendeur de logiciel
    Browse all 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
    • Devenez partenaire
    • Services for Partners
    • 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

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

  • CRM
  • e-Commerce
  • Comptabilité
  • Inventaire
  • PoS
  • Projet
  • MRP
All apps
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

Odoo11: kanban background color

S'inscrire

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

Cette question a été signalée
kanbanbackgroundodoo11JS
1 Répondre
9051 Vues
Avatar
Lucia C.H.

We are using Odoo11 with the standard CRM addon.

Our users would like to have a (light) red background for lost opportunities and a (light) green background for won opportunities in the kanban view (model: crm.lead).

I have found that the option to color the background was replaced by a colored bar from v10 onwards. See: https://github.com/odoo/odoo/issues/34504

However, one answer to the issue contains a sample of how the background can be colored anyway.

I tried to modify this approach according to my needs but I cannot get it to work. Can someone here help, please?

I tried to add a condition that changes the background color depending on the probability: 0 means "lost" => red background, 100 means "won" => green background.

The resulting error message is all about Javascript & as I'm no pro in JS I'm clueless what it means.

My code looks like this:

<xpath expr="/kanban/templates/t/div//div[@class='oe_kanban_content']"
position="replace">
<div t-if="record.probability.raw_value == 0" style="background-color: #00FF00;">
<div class="oe_kanban_content">
...
... (I inserted code from the original view here - not good practice, I know)
...
</div>
</div>
</xpath>
0
Avatar
Ignorer
Lucia C.H.
Auteur

Hello Chris, thank you for your answer. This took me on step further (kind of) but it didn't solve my problem.

One step further because the code works & does indead change the color of the kanban items - but instead of the background it only changes the thin bar on the left side.

The field x_studio_vip_color is nothing 'special' coming from JS - it's just a field you added on your own, right?

One question: The original code uses class="oe_kanban_content" and not class="o_kanban_card_content". Does that make a (big) difference?

Chris TRINGHAM

Sorry, this is an example that I managed to get working in a test database without fully understanding all the details. The concept is that there are VIP customers so the Kanban card changes color. That field was added to the customer.

On my system it changes the background color of the card. What version of Odoo are you using?

Lucia C.H.
Auteur

<p>

We are using Odoo11.

<br/></p>

Avatar
Chris TRINGHAM
Meilleure réponse

This might work.  It uses an (invisible) field x_studio_vip_color to control the color

<kanban string="Customer Product">

<templates>
<t t-name="kanban-box">
<div t-attf-class="oe_kanban_bg_custom
#{kanban_color(record.x_studio_vip_color.raw_value)}
oe_kanban_global_click">
<div class="o_kanban_card_content">
<field name="id" modifiers="{"readonly": true}"/>
<field name="x_studio_vip_color" attrs="{}" invisible="1"/>
</div>
</div>
</t>
</templates>
</kanban>
-1
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é
trim content in kanban view -Odoo 11
kanban odoo11
Avatar
Avatar
1
avr. 19
5454
TypeError: node is undefined Kanban view Résolu
xml kanban odoo11
Avatar
1
sept. 21
9332
how to change group_by in existing kanban view in odoo 11 Résolu
kanban group_by odoo11
Avatar
Avatar
1
avr. 21
4634
on_create functionality in tree view
tree kanban odoo11
Avatar
0
nov. 19
4980
ODOO11: Total of Colum in kanban view
kanban total odoo11
Avatar
0
nov. 18
3062
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
  • Devenez 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 ภาษาไทย 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