Odoo Help

0

How can I change status color in calendar view?

By
venugopal voraganti
on 7/5/15, 4:49 AM 1,651 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?.

1
Axel Mendoza
On 7/14/15, 12:19 AM

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


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.

venugopal voraganti
on 7/14/15, 4:16 AM

I edited my answer. This you solve this?

Axel Mendoza
on 7/17/15, 12:30 PM

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

venugopal voraganti
on 7/26/15, 4:28 AM

solved?

Axel Mendoza
on 12/23/15, 3:19 PM

About This Community

This platform 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.

Register

Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

2 follower(s)

Stats

Asked: 7/5/15, 4:49 AM
Seen: 1651 times
Last updated: 7/21/15, 1:35 AM