diff --git a/addons/mail/mail_message.py b/addons/mail/mail_message.py index aec106f766b..6300ccf2bc5 100644 --- a/addons/mail/mail_message.py +++ b/addons/mail/mail_message.py @@ -564,6 +564,7 @@ class mail_message(osv.Model): - uid have write access on the related document if model, res_id, OR - otherwise: raise - write: if + - author_id == pid, uid is the author, OR - uid has write access on the related document if model, res_id - Otherwise: raise - unlink: if @@ -586,7 +587,7 @@ class mail_message(osv.Model): model_record_ids.setdefault(rmod, dict()).setdefault(rid, set()).add(id) # Author condition, for read and create (private message) -> could become an ir.rule, but not till we do not have a many2one variable field - if operation == 'read': + if operation == 'read' or operation == 'write': author_ids = [mid for mid, message in message_values.iteritems() if message.get('author_id') and message.get('author_id') == partner_id] elif operation == 'create': diff --git a/addons/mail/wizard/invite.py b/addons/mail/wizard/invite.py index 6deaf133bf5..6022d2b07be 100644 --- a/addons/mail/wizard/invite.py +++ b/addons/mail/wizard/invite.py @@ -71,6 +71,8 @@ class invite_wizard(osv.osv_memory): # send an email if wizard.message: + # the invite wizard should create a private message not related to any object, + # we ensure that by overwriting off res_id and res_model default value of the context for follower_id in new_follower_ids: mail_mail = self.pool.get('mail.mail') mail_id = mail_mail.create(cr, uid, {