From 38470a93d2e1441f80272a2f303583489beb4fab Mon Sep 17 00:00:00 2001 From: "atp (Open ERP)" Date: Fri, 19 Mar 2010 11:29:41 +0530 Subject: [PATCH] [IMP]: base_calendar: Fixed problem in accepting invitation, NoneType ref field value bzr revid: atp@tinyerp.co.in-20100319055941-cvupsmhmbcq2iqd3 --- addons/base_calendar/base_calendar.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/addons/base_calendar/base_calendar.py b/addons/base_calendar/base_calendar.py index 0ef73c19794..4aa274a0a68 100644 --- a/addons/base_calendar/base_calendar.py +++ b/addons/base_calendar/base_calendar.py @@ -294,14 +294,15 @@ class invite_attendee_wizard(osv.osv_memory): mail_to.append(contact.email) att = att_obj.browse(cr, uid, context_id) + for att_val in vals: if model == 'calendar.attendee': - att_val.update({ - 'parent_ids': [(4, att.id)], - 'ref': att.ref._name + ',' + str(att.ref.id) - }) + if ref: + 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: obj.write(cr, uid, res_obj.id, {model_field: [(4, attendee)]}) @@ -534,7 +535,6 @@ request was delegated to"), @param context: A standard dictionary for contextual values @return: True """ - company = self.pool.get('res.users').browse(cr, uid, uid, context=context).company_id.name for att in self.browse(cr, uid, ids, context=context): sign = att.sent_by_uid and att.sent_by_uid.signature or '' @@ -598,15 +598,18 @@ request was delegated to"), """ if not context: context = {} + for vals in self.browse(cr, uid, ids, context=context): user = vals.user_id if user: + mod_obj = self.pool.get(vals.ref._name) if vals.ref: if vals.ref.user_id.id != user.id: defaults = {'user_id': user.id} new_event = mod_obj.copy(cr, uid, vals.ref.id, default=defaults, context=context) self.write(cr, uid, vals.id, {'state': 'accepted'}, context) + return True def do_decline(self, cr, uid, ids, context=None, *args):