summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
authorDamien Bouvy <dbo@odoo.com>2015-08-31 21:16:22 +0200
committerDamien Bouvy <dbo@odoo.com>2015-08-31 21:56:18 +0200
commit37c62282a2d7b0dae806b0c4d66f5d2bbaae8b6b (patch)
treed7542db7300acde0dd6651d38b1d42b6da02d368 /addons
parentdf2bed3c16617aa88f525cca9c95147690ad1638 (diff)
[FIX] website_mail: if there is a partner linked to the user, let him write
Who's the idiot who coded this stupi... Oh. Right. Never mind.
Diffstat (limited to 'addons')
-rw-r--r--addons/website_mail/controllers/main.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/addons/website_mail/controllers/main.py b/addons/website_mail/controllers/main.py
index 58123e84e44..b36378961a9 100644
--- a/addons/website_mail/controllers/main.py
+++ b/addons/website_mail/controllers/main.py
@@ -54,7 +54,9 @@ def _message_post_helper(res_model='', res_id=None, message='', token='', token_
if request.env.user == request.env['ir.model.data'].xmlid_to_object('base.public_user'):
author_id = (res.partner_id and res.partner_id.id) if hasattr(res, 'partner_id') else author_id
else:
- raise NotFound()
+ author_id = request.env.user.partner_id and request.env.user.partner_id.id
+ if not author_id:
+ raise NotFound()
elif sha_in:
timestamp = int(sha_time)
secret = request.env['ir.config_parameter'].sudo().get_param('database.secret')