[IMP]: current user will see as a you, his/her name will not seen in respective email template, when they got mail

bzr revid: aja@tinyerp.com-20130715094053-oiggvpb4k4qswoau
This commit is contained in:
ajay javiya (OpenERP)
2013-07-15 15:10:53 +05:30
parent 7846379665
commit f2a2a3eefc
3 changed files with 8 additions and 7 deletions
+4 -4
View File
@@ -434,11 +434,10 @@ property or property parameter."),
att_info = []
sub = res_obj.name
other_invitation_ids = self.search(cr, uid, [('ref', '=', res_obj._name + ',' + str(res_obj.id))])
other_invitation_ids.remove(attendee.id)
for att2 in self.browse(cr, uid, other_invitation_ids):
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)
@@ -455,17 +454,18 @@ property or property parameter."),
map_url = ''
if res_obj.location:
map_url = """<span style= "color:#A9A9A9; "> (<a href="http://maps.google.com/maps?oi=map&q=%s">View Map</a>)</span>""" % res_obj.location
org = [(image_cricle % color.get('needs-action')) + 'You', (image_cricle % color.get('accepted')) + res_obj.organizer]
body_vals = {'user':attendee.user_id and attendee.user_id.name,
'name': res_obj.name,
'responsible': res_obj.user_id and res_obj.user_id.name or 'OpenERP User',
'company': company,
'description': res_obj.description or '-',
'attendees': ',\n' .join(att_info),
'attendees': ',\n' .join(att_info),
'time': time,
'tz': tz,
'location': res_obj.location or '-',
'map' : map_url or '',
'organizer': res_obj.organizer,
'organizer':',\n' .join(org),
'url' : footer}
body_id = self.pool.get('email.template').search(cr, uid, [('subject', '=', 'Meeting Invitation')], context=context)
body = self.pool.get('email.template').browse(cr, uid, body_id[0], context=context).body_html % body_vals
+1 -1
View File
@@ -174,7 +174,7 @@
<td colspan="3"> <div style = " font-family: Lucica Grande', Ubuntu, Arial, Verdana, sans-serif; font-size: 14px" >%(description)s</div> </td> </tr>
<tr valign="top">
<td style = "height: 25px;width: 120px; background : # CCCCCC; font-family: Lucica Grande', Ubuntu, Arial, Verdana, sans-serif; font-size: 14px;"> <div><b>Attendees:<b></div> </td>
<td colspan="3"><div style = " font-family: Lucica Grande', Ubuntu, Arial, Verdana, sans-serif; font-size: 10px" > You, %(organizer)s <span style= "color:#A9A9A9; ont-size: 9px">- Organizer </br></span>%(attendees)s</div> </td> </tr>
<td colspan="3"><div style = " font-family: Lucica Grande', Ubuntu, Arial, Verdana, sans-serif; font-size: 10px" > %(organizer)s <span style= "color:#A9A9A9; ont-size: 9px">- Organizer </br></span>%(attendees)s</div> </td> </tr>
</table></td></tr>
<tr >
<td><div style = " font-family: Lucica Grande', Ubuntu, Arial, Verdana, sans-serif; font-size: 10px" ><span style= "margin-top: 50px; margin-left: 200px;" ><a href="%(url)s&view_type=form&status=accepted">Accept</a> | <a href="%(url)s&view_type=form&status=declined">Decline</a></span></div> </td>
@@ -181,7 +181,7 @@ instance.base_calendar = {}
}
};
if (! values || values.length > 0) {
if(self.getParent().datarecord.attendee_ids){
if(self.getParent().datarecord.attendee_ids && self.getParent().datarecord.attendee_ids.length == values.length){
return new instance.web.Model("calendar.attendee").call('read',[self.getParent().datarecord.attendee_ids ,['state','cn','partner_id']]).then(function(res){
data = []
_.each(res,function(val){
@@ -189,7 +189,8 @@ instance.base_calendar = {}
});
handle_names(data)
});
} else { this._display_orderer.add(dataset.name_get(values)).done(handle_names); }
} else {
this._display_orderer.add(dataset.name_get(values)).done(handle_names); }
} else { handle_names([]); }
},