summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThibault Delavallée <tde@openerp.com>2013-01-04 10:03:17 +0100
committerThibault Delavallée <tde@openerp.com>2013-01-04 10:03:17 +0100
commit7967c20af4adcfa32700a335f315d92b90f2fb0f (patch)
treebfa66bb4c0f76fcab0e5aa6db45e882c826b37c9
parente88795ae66bf1d6590caa3961319b87fc7244077 (diff)
parent0170f78af9bd0a0be6e494ca3154625c880e0ca9 (diff)
[FIX] message_route: removed owner of created documents using aliases taken from the 'from' of the incoming email, because we cannot ensure that this user has any create or write access rights. If no owner is defined on the alias, uid will be used instead.
bzr revid: tde@openerp.com-20130104090317-kzv48yepno4t5dcp
-rw-r--r--addons/mail/mail_thread.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/addons/mail/mail_thread.py b/addons/mail/mail_thread.py
index b70fc6078cc..be34153e316 100644
--- a/addons/mail/mail_thread.py
+++ b/addons/mail/mail_thread.py
@@ -491,7 +491,13 @@ class mail_thread(osv.AbstractModel):
for alias in mail_alias.browse(cr, uid, alias_ids, context=context):
user_id = alias.alias_user_id.id
if not user_id:
- user_id = self._message_find_user_id(cr, uid, message, context=context)
+ # TDE note: this could cause crashes, because no clue that the user
+ # that send the email has the right to create or modify a new document
+ # Fallback on user_id = uid
+ # Note: recognized partners will be added as followers anyway
+ # user_id = self._message_find_user_id(cr, uid, message, context=context)
+ user_id = uid
+ _logger.debug('No matching user_id for the alias %s', alias.alias_name)
routes.append((alias.alias_model_id.model, alias.alias_force_thread_id, \
eval(alias.alias_defaults), user_id))
_logger.debug('Routing mail with Message-Id %s: direct alias match: %r', message_id, routes)