Skip to Content
Menu
This question has been flagged
2 Replies
8746 Views

I am creating a custom module and want the cards in kanban view to change based on their age. I currently have the field:

checkin_date = fields.Date(default=fields.Date.today) 

This is set whenever the form is filled out initially. In kanban I want to change the color based on how long ago checkin_date occurred. 

Example: If  current date - checkin_date < 3 days, kanban cards stay the same color. If 3=5, the cards are yellow. >5 is red. This way we can immediately see the age of the items we need to deal with first.

EDIT: How do I calculate the age of the item based on the checkin_date? 

Odoo V11 Community

Avatar
Discard
Best Answer

just define a field for the colour index

color = fields.Integer('Color Index')

and the possible values for the colour index are

0 grey

1 green

2 yellow

3 orange

4 red

5 purple

6 blue

7 cyan

8 light green

9 magenta

Assign these values according to your conditions.

Avatar
Discard
Author

This would work for the coloring, but how do I calculate the age? And set it up for ages to show those colors?

Best Answer

Refer this link:-

https://www.odoo.com/forum/help-1/question/kanban-attribute-how-to-change-the-color-24271

Avatar
Discard
Related Posts Replies Views Activity
1
May 22
1229
1
Mar 15
4064
1
May 24
299
2
Mar 24
6113
1
Feb 24
938