From 4d96d4657d3453a562eb552b529a2d4258a8c7ad Mon Sep 17 00:00:00 2001 From: "olt@tinyerp.com" <> Date: Mon, 20 Sep 2010 13:37:45 +0200 Subject: [PATCH] [FIX] base_calendar: access to browse_null attributes bzr revid: olt@tinyerp.com-20100920113745-o45rgjk2onl4aja5 --- addons/base_calendar/base_calendar.py | 8 ++++++-- .../base_calendar/wizard/base_calendar_invite_attendee.py | 3 ++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/addons/base_calendar/base_calendar.py b/addons/base_calendar/base_calendar.py index 11bd22e6134..a08af3da241 100644 --- a/addons/base_calendar/base_calendar.py +++ b/addons/base_calendar/base_calendar.py @@ -484,8 +484,12 @@ property or property parameter."), res_obj = att.ref sub = res_obj.name att_infos = [] - other_invitaion_ids = self.search(cr, uid, [('ref', '=', res_obj._name + ',' + str(res_obj.id))]) - for att2 in self.browse(cr, uid, other_invitaion_ids): + if res_obj: + other_invitation_ids = self.search(cr, uid, [('ref', '=', res_obj._name + ',' + str(res_obj.id))])a + else: + other_invitation_ids = [] + + for att2 in self.browse(cr, uid, other_invitation_ids): att_infos.append(((att2.user_id and att2.user_id.name) or \ (att2.partner_id and att2.partner_id.name) or \ att2.email) + ' - Status: ' + att2.state.title()) diff --git a/addons/base_calendar/wizard/base_calendar_invite_attendee.py b/addons/base_calendar/wizard/base_calendar_invite_attendee.py index f60139c0600..98369962ab7 100644 --- a/addons/base_calendar/wizard/base_calendar_invite_attendee.py +++ b/addons/base_calendar/wizard/base_calendar_invite_attendee.py @@ -128,8 +128,9 @@ send an Email to Invited Person') att = att_obj.browse(cr, uid, context_id) att_val.update({ 'parent_ids': [(4, att.id)], - 'ref': att.ref._name + ',' +str(att.ref.id) + 'ref': att.ref and (att.ref._name + ',' +str(att.ref.id)) or False }) + attendees.append(att_obj.create(cr, uid, att_val)) if model_field: for attendee in attendees: