[FIX] mail.message: allow reading msg even if author belongs to another company

lp bug: https://launchpad.net/bugs/944813 fixed

bzr revid: odo@openerp.com-20120319145331-thrtlzardl8rikkf
This commit is contained in:
Olivier Dony 2012-03-19 15:53:31 +01:00
parent 3f5fb80a76
commit ce2f1173a9
1 changed files with 4 additions and 1 deletions

View File

@ -33,6 +33,7 @@ import tools
from osv import osv
from osv import fields
from tools.translate import _
from openerp import SUPERUSER_ID
_logger = logging.getLogger('mail')
@ -149,7 +150,9 @@ class mail_message(osv.osv):
context = {}
tz = context.get('tz')
result = {}
for message in self.browse(cr, uid, ids, context=context):
# Read message as UID 1 to allow viewing author even if from different company
for message in self.browse(cr, SUPERUSER_ID, ids):
msg_txt = ''
if message.email_from:
msg_txt += _('%s wrote on %s: \n Subject: %s \n\t') % (message.email_from or '/', format_date_tz(message.date, tz), message.subject)