[FIX] base_calendar: access to browse_null attributes

bzr revid: olt@tinyerp.com-20100920113745-o45rgjk2onl4aja5
This commit is contained in:
olt@tinyerp.com 2010-09-20 13:37:45 +02:00
parent f691dc9f77
commit 4d96d4657d
2 changed files with 8 additions and 3 deletions

View File

@ -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())

View File

@ -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: