From feef1f6b8f1d77ce8edaf90d894785366862c717 Mon Sep 17 00:00:00 2001 From: Vidhin Mehta Date: Fri, 12 Jul 2013 17:21:22 +0530 Subject: [PATCH] [IMP]show circle according to state field in email. bzr revid: vme@tinyerp.com-20130712115122-2nh946w44fagji18 --- addons/base_calendar/base_calendar.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/addons/base_calendar/base_calendar.py b/addons/base_calendar/base_calendar.py index c92b4dc325f..1a342d4a035 100644 --- a/addons/base_calendar/base_calendar.py +++ b/addons/base_calendar/base_calendar.py @@ -419,6 +419,14 @@ property or property parameter."), """ company = self.pool.get('res.users').browse(cr, uid, uid, context=context).company_id.name mail_id = [] + color = { + 'needs-action' : 'grey', + 'accepted' :'green', + 'tentative' :'#FFFF00', + 'declined':'red', + 'delegated':'grey' + } + image_cricle = "
" for attendee in self.browse(cr, uid, ids, context=context): res_obj = attendee.ref if res_obj: @@ -428,7 +436,9 @@ property or property parameter."), other_invitation_ids = self.search(cr, uid, [('ref', '=', res_obj._name + ',' + str(res_obj.id))]) for att2 in self.browse(cr, uid, other_invitation_ids): - att_info.append(att2.user_id and att2.user_id.name or att2.partner_id and att2.partner_id.name or att2.email) + name = att2.user_id and att2.user_id.name or att2.partner_id and att2.partner_id.name or att2.email + att_info.append((image_cricle % color.get(att2.state)) + name) + tz = context.get('tz', pytz.timezone('UTC')) allday = False date = fields.datetime.context_timestamp(cr, uid, datetime.strptime(res_obj.date, tools.DEFAULT_SERVER_DATETIME_FORMAT), context=context)