From: Thibault Delavallée Date: Thu, 3 Jan 2013 17:26:21 +0000 (+0100) Subject: [FIX] message_route: removed owner of created documents using aliases taken from... X-Git-Tag: 7.0-server~86^2~1 X-Git-Url: http://git.inspyration.org/?a=commitdiff_plain;h=982cfa5d4760892f9507743cb24ccf4e8f18f4f2;p=odoo%2Fodoo.git [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-20130103172621-4qoz28npnq4c5e7i --- diff --git a/addons/mail/mail_thread.py b/addons/mail/mail_thread.py index b70fc60..12e43d0 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('Routing mail with Message-Id %s: direct alias match: %r', message_id, routes) 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)