Odoo Help


This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

Ajeet Yadav
On 8/13/16, 7:29 AM

create new functional fields color in .py file that will change values as per state.

def change_colore_on_kanban(self):
 """ this method is used to chenge color index base on fee status ---------------------------------------- :return: index of color for kanban view """
    for record in self:
         color = 0
         if record.status == 'occupied':
             color = 2
         elif record.status == 'available':
             color = 5
         elif record.cleaning_status == 'dirty':
             color = 7
         elif record.cleaning_status == 'cleaned':
             color = 5
         record.color = color

color = fields.Integer('Color Index', compute="change_colore_on_kanban")

then define kanban color on new field in xml file.

<div t-attf-class="#{kanban_color(record.color.raw_value)}">

Thanks Ajeet

Giezel Esteves
on 8/31/16, 8:12 PM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

2 follower(s)


Asked: 8/13/16, 3:36 AM
Seen: 234 times
Last updated: 8/15/16, 3:45 AM