[MERGE] from trunk-bug-1075501-vta

bzr revid: chm@openerp.com-20121206124328-o063xc0w2tavbmik
This commit is contained in:
Christophe Matthieu
2012-12-06 13:43:28 +01:00
2 changed files with 4 additions and 1 deletions
+2 -1
View File
@@ -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':
+2
View File
@@ -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, {