diff --git a/addons/base_calendar/base_calendar.py b/addons/base_calendar/base_calendar.py index e97ee3bd547..fd1d60914d1 100644 --- a/addons/base_calendar/base_calendar.py +++ b/addons/base_calendar/base_calendar.py @@ -243,22 +243,22 @@ class calendar_attendee(osv.osv): attdata.sent_by_uid.address_id.email) if name == 'cn': if attdata.user_id: - result[id][name] = self._get_address(attdata.user_id.name, attdata.email) + result[id][name] = attdata.user_id.name elif attdata.partner_address_id: - result[id][name] = self._get_address(attdata.partner_id.name, attdata.email) + result[id][name] = attdata.partner_address_id.name or attdata.partner_id.name else: - result[id][name] = self._get_address(None, attdata.email) + result[id][name] = attdata.email or '' if name == 'delegated_to': todata = [] - for parent in attdata.parent_ids: - if parent.email: - todata.append('MAILTO:' + parent.email) + for child in attdata.child_ids: + if child.email: + todata.append('MAILTO:' + child.email) result[id][name] = ', '.join(todata) if name == 'delegated_from': fromdata = [] - for child in attdata.child_ids: - if child.email: - fromdata.append('MAILTO:' + child.email) + for parent in attdata.parent_ids: + if parent.email: + fromdata.append('MAILTO:' + parent.email) result[id][name] = ', '.join(fromdata) if name == 'event_date': if attdata.ref: diff --git a/addons/base_calendar/base_calendar_view.xml b/addons/base_calendar/base_calendar_view.xml index d9acae67a9e..0c8a52260ef 100644 --- a/addons/base_calendar/base_calendar_view.xml +++ b/addons/base_calendar/base_calendar_view.xml @@ -8,8 +8,13 @@ form
- - + + + + + + + @@ -20,9 +25,6 @@ string="Partner Contact" /> - - - @@ -181,7 +183,7 @@ calendar.event form - + @@ -257,7 +259,6 @@ - @@ -333,6 +334,7 @@ + @@ -353,6 +355,44 @@ + + + + Calendar Events Search + calendar.event + search + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -361,6 +401,7 @@ calendar.event form tree,form,calendar + diff --git a/addons/base_calendar/wizard/base_calendar_invite_attendee.py b/addons/base_calendar/wizard/base_calendar_invite_attendee.py index 83cf7c8cbe0..cb3e4d2e62a 100644 --- a/addons/base_calendar/wizard/base_calendar_invite_attendee.py +++ b/addons/base_calendar/wizard/base_calendar_invite_attendee.py @@ -66,20 +66,19 @@ send an Email to Invited Person') model = False model_field = False - context_id = context and context.get('active_id', False) or False if not context or not context.get('model'): return {} else: model = context.get('model') + model_field = context.get('attendee_field', False) + obj = self.pool.get(model) + res_obj = obj.browse(cr, uid, context_id) + att_obj = self.pool.get('calendar.attendee') for datas in self.read(cr, uid, ids, context=context): - - obj = self.pool.get(model) - res_obj = obj.browse(cr, uid, context_id) type = datas.get('type') - att_obj = self.pool.get('calendar.attendee') vals = [] mail_to = [] attendees = [] @@ -123,15 +122,13 @@ send an Email to Invited Person') if contact.email: mail_to.append(contact.email) - att = att_obj.browse(cr, uid, context_id) - for att_val in vals: if model == 'calendar.attendee': - if ref: - att_val.update({ - 'parent_ids': [(4, att.id)], - 'ref': att.ref._name + ',' +str(att.ref.id) - }) + att = att_obj.browse(cr, uid, context_id) + att_val.update({ + 'parent_ids': [(4, att.id)], + 'ref': att.ref._name + ',' +str(att.ref.id) + }) attendees.append(att_obj.create(cr, uid, att_val)) if model_field: for attendee in attendees: