From 9c8b9a80becbe864a09795c59849879c798e2f35 Mon Sep 17 00:00:00 2001 From: Christophe Matthieu Date: Wed, 5 Dec 2012 16:52:29 +0100 Subject: [PATCH] [FIX] mail: when a user try to invite a follower to a project/task, no access error. debug: overwrite context model and res_id. bzr revid: chm@openerp.com-20121205155229-8mbjlrciuclnmx2r --- addons/mail/wizard/invite.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/addons/mail/wizard/invite.py b/addons/mail/wizard/invite.py index 50ecf9450da..6deaf133bf5 100644 --- a/addons/mail/wizard/invite.py +++ b/addons/mail/wizard/invite.py @@ -68,7 +68,7 @@ class invite_wizard(osv.osv_memory): # filter partner_ids to get the new followers, to avoid sending email to already following partners new_follower_ids = [p.id for p in wizard.partner_ids if p.id not in document.message_follower_ids] model_obj.message_subscribe(cr, uid, [wizard.res_id], new_follower_ids, context=context) - + # send an email if wizard.message: for follower_id in new_follower_ids: @@ -77,6 +77,8 @@ class invite_wizard(osv.osv_memory): 'subject': 'Invitation to follow %s' % document.name_get()[0][1], 'body_html': '%s' % wizard.message, 'auto_delete': True, + 'res_id': False, + 'model': None }, context=context) mail_mail.send(cr, uid, [mail_id], recipient_ids=[follower_id], context=context) return {'type': 'ir.actions.act_window_close'}