[FIX] Dirty fix for links sent by email

bzr revid: rim@openerp.com-20140410141352-tb9rwbvawuy2kwc4
This commit is contained in:
Richard Mathot (OpenERP) 2014-04-10 16:13:52 +02:00
parent 89a60326da
commit ea69de5114
2 changed files with 6 additions and 1 deletions

View File

@ -26,6 +26,7 @@ from datetime import datetime
import re
import uuid
import urlparse
emails_split = re.compile(r"[;,\n\r]+")
@ -137,8 +138,12 @@ class survey_mail_compose_message(osv.TransientModel):
""" Create one mail by recipients and replace __URL__ by link with identification token """
#set url
url = wizard.survey_id.public_url
url = urlparse.urlparse(url).path[1:] # dirty hack to avoid incorrect urls
if token:
url = url + '/' + token
# post the message
values = {
'model': None,

View File

@ -50,7 +50,7 @@
<field invisible="context.get('survey_resent_token')" name="multi_email" placeholder="Add list of email of recipients (will not converted in partner), separated by commas, semicolons or newline..." on_change="onchange_multi_email(multi_email)" no_resize="1" />
<field name="subject" placeholder="Subject..."/>
</group>
<field name="body" help="__URL__ will be automatically transformed into web address (public or private, depending on your choice). You can click on 'Show Source' button to see __URL__ in the link tag on the email template."/>
<field name="body" />
<group col="2">
<div>
<label for="attachment_ids" />