Skip to Content
Menu
This question has been flagged
1 Reply
10704 Views

I am getting bit confusion in changing the color of a record based on its status in calendar view. Can anyone help me how can I change the color of status in calendar view?.

Avatar
Discard
Best Answer

Normally you should define what is the field that define a different color(using the color attribute of calendar tag) based on the values it may have. So in your case if that field is the state field you could do something like this:

<calendar string="Appointments" color="state" date_start="appointment_date" date_delay="duration">
<field name="patient_name"/>
</calendar>


Edited:

For your requirement to manually map your states with a color you will need to extends the widget instance.web_calendar.CalendarView the init function to initialize the object "this.color_map" with your map of values to color


Avatar
Discard
Author

Hey Axel..tq for your reply. I know how to use color attribute but in my case I want to define my own colors like green,red,blue,etc. to 'status' field as we normally to in tree view.

I edited my answer. This you solve this?

Author

tq so much Axel..I'll try the way u told.

did you solved it? I need the same thing

Related Posts Replies Views Activity
1
Jun 23
2000
1
Apr 21
1150
1
Feb 18
1675
1
Jan 24
316
1
Sep 23
528