[IMP]: caldav: Improvement for proper attendee and company information
bzr revid: rpa@openerp.co.in-20100203105648-mwt3wyf8tu85q6b0
This commit is contained in:
parent
1bb30ecef0
commit
75a5d84b4a
|
@ -325,7 +325,7 @@ request was delegated to"),
|
||||||
def msg_update(self, cr, uid, ids, msg, data={}, default_act='None'):
|
def msg_update(self, cr, uid, ids, msg, data={}, default_act='None'):
|
||||||
msg_actions = self.msg_act_get(msg)
|
msg_actions = self.msg_act_get(msg)
|
||||||
if msg_actions.get('state'):
|
if msg_actions.get('state'):
|
||||||
if msg_actions['state'] in ['YES','NO','MAYBE']:
|
if msg_actions['state'] in ['YES', 'NO', 'MAYBE']:
|
||||||
mapping = {'YES': 'accepted', 'NO': 'declined', 'MAYBE': 'tentative'}
|
mapping = {'YES': 'accepted', 'NO': 'declined', 'MAYBE': 'tentative'}
|
||||||
status = mapping[msg_actions['state']]
|
status = mapping[msg_actions['state']]
|
||||||
print 'Got response for invitation id: %s as %s' % (ids, status)
|
print 'Got response for invitation id: %s as %s' % (ids, status)
|
||||||
|
@ -541,7 +541,7 @@ or contains the text to be used for display"""),
|
||||||
mail_to.append(att.user_id.address_id.email)
|
mail_to.append(att.user_id.address_id.email)
|
||||||
|
|
||||||
tools.email_send(
|
tools.email_send(
|
||||||
tools.confirm['from_mail'],
|
tools.config.get('email_from',False),
|
||||||
mail_to,
|
mail_to,
|
||||||
sub,
|
sub,
|
||||||
body
|
body
|
||||||
|
@ -1189,17 +1189,23 @@ class invite_attendee_wizard(osv.osv_memory):
|
||||||
|
|
||||||
elif type == 'external' and datas.get('email'):
|
elif type == 'external' and datas.get('email'):
|
||||||
vals.update({'email': datas['email']})
|
vals.update({'email': datas['email']})
|
||||||
|
company = self.pool.get('res.users').browse(cr, uid, uid, context=context).company_id.name
|
||||||
|
att_infos = []
|
||||||
|
for att in res_obj.attendee_ids:
|
||||||
|
att_infos.append(((att.user_id and att.user_id.name) or \
|
||||||
|
(att.partner_id and att.partner_id.name) or \
|
||||||
|
att.email) + ' - Status: ' + att.state.title())
|
||||||
att_id = att_obj.create(cr, uid, vals)
|
att_id = att_obj.create(cr, uid, vals)
|
||||||
obj.write(cr, uid, res_obj.id, {'attendee_ids': [(4, att_id)]})
|
obj.write(cr, uid, res_obj.id, {'attendee_ids': [(4, att_id)]})
|
||||||
sign = res_obj.user_id and res_obj.user_id.signature or ''
|
sign = res_obj.user_id and res_obj.user_id.signature or ''
|
||||||
sign = '<br>'.join(sign and sign.split('\n') or [])
|
sign = '<br>'.join(sign and sign.split('\n') or [])
|
||||||
sub = '[%d] %s' % (att_id, res_obj.name)
|
sub = '[%s Invitation][%d] %s' % (company, att_id, res_obj.name)
|
||||||
body_vals = {'name': res_obj.name,
|
body_vals = {'name': res_obj.name,
|
||||||
'start_date': res_obj.date,
|
'start_date': res_obj.date,
|
||||||
'end_date': res_obj.date_deadline or None,
|
'end_date': res_obj.date_deadline or None,
|
||||||
'description': res_obj.description,
|
'description': res_obj.description,
|
||||||
'location': res_obj.location or '-',
|
'location': res_obj.location or '-',
|
||||||
'attendees': '-', #Todo
|
'attendees': '<br>'.join(att_infos), #Todo
|
||||||
'user': res_obj.user_id and res_obj.user_id.name or 'OpenERP User',
|
'user': res_obj.user_id and res_obj.user_id.name or 'OpenERP User',
|
||||||
'sign': sign
|
'sign': sign
|
||||||
}
|
}
|
||||||
|
@ -1211,7 +1217,7 @@ class invite_attendee_wizard(osv.osv_memory):
|
||||||
sub,
|
sub,
|
||||||
body,
|
body,
|
||||||
subtype='html',
|
subtype='html',
|
||||||
reply_to=tools.config.get('email_from',False),
|
reply_to=tools.config.get('email_from',False)
|
||||||
)
|
)
|
||||||
|
|
||||||
elif type == 'partner':
|
elif type == 'partner':
|
||||||
|
|
Loading…
Reference in New Issue