<p>Thanks,</p>
<pre>
-${ctx['partner_id'].user_id and ctx['partner_id'].user_id.signature or ''}
+${ctx['partner_id'].user_id and ctx['partner_id'].user_id.signature | safe or ''}
</pre>
% if not ctx['partner_id'].user_id:
PS: It looks like you do not have an account manager assigned to you, please contact us.
<p>If you want more details, feel free to contact us by phone.</p>
<p>Kind regards,</p>
<br/>
- ${object.user_id and object.user_id.signature or ''}]]></field>
+ ${object.user_id and object.user_id.signature | safe or ''}]]></field>
</record>
<record id="applicant_interest" model="email.template">
If I do not answer, please let me a message with some schedules to call you back.</p>
<p>Kind regards,</p>
<br/>
- ${object.user_id.signature}]]></field>
+ ${object.user_id.signature | safe}]]></field>
</record>
<!-- HR Recruitment Source -->
# add user signature
user = self.pool.get("res.users").browse(cr, SUPERUSER_ID, [user_id], context=context)[0]
if user.signature:
- signature = plaintext2html(user.signature)
+ signature = user.signature
else:
signature = "--<br />%s" % user.name
- footer = tools.append_content_to_html(footer, signature, plaintext=False, container_tag='p')
-
+ footer = tools.append_content_to_html(footer, signature, plaintext=False)
# add company signature
if user.company_id.website:
website_url = ('http://%s' % user.company_id.website) if not user.company_id.website.lower().startswith(('http:', 'https:')) \
from openerp.addons.mail.mail_mail import mail_mail
from openerp.addons.mail.mail_thread import mail_thread
from openerp.addons.mail.tests.common import TestMail
-from openerp.tools import mute_logger, email_split
+from openerp.tools import mute_logger, email_split, html2plaintext
from openerp.tools.mail import html_sanitize
-
class test_mail(TestMail):
def test_000_alias_setup(self):
'message_post: notification email body alternative should contain the body')
self.assertNotIn('<p>', sent_email['body_alternative'],
'message_post: notification email body alternative still contains html')
- self.assertIn(user_raoul.signature, sent_email['body_alternative'],
+ self.assertIn(html2plaintext(user_raoul.signature), sent_email['body_alternative'],
'message_post: notification email body alternative should contain the sender signature')
self.assertFalse(sent_email['references'],
'message_post: references should be False when sending a message that is not a reply')
'message_post: notification email body alternative should contain the body')
self.assertNotIn('<p>', sent_email['body_alternative'],
'message_post: notification email body alternative still contains html')
- self.assertIn(user_raoul.signature, sent_email['body_alternative'],
+ self.assertIn(html2plaintext(user_raoul.signature), sent_email['body_alternative'],
'message_post: notification email body alternative should contain the sender signature')
self.assertIn(msg_message_id, sent_email['references'],
'message_post: notification email references lacks parent message message_id')
<field name="partner_id" ref="partner_demo_portal"/>
<field name="login">portal</field>
<field name="password">portal</field>
- <field name="signature">--
-Mr Demo Portal</field>
+ <field name="signature"><![CDATA[<span>--<br/>
+Mr Demo Portal</span>]]></field>
<!-- Avoid auto-including this user in any default group -->
<field name="groups_id" eval="[(5,)]"/>
</record>
<field name="partner_id" ref="base.partner_root"/>
<field name="company_id" ref="main_company"/>
<field name="company_ids" eval="[(4, ref('main_company'))]"/>
- <field name="signature">--
-Administrator</field>
+ <field name="signature"><![CDATA[<span>--<br/>
+Administrator</span>]]></field>
</record>
<record id="main_partner" model="res.partner">
help="Specify a value only when creating a user or if you're "\
"changing the user's password, otherwise leave empty. After "\
"a change of password, the user has to login again."),
- 'signature': fields.text('Signature'),
+ 'signature': fields.html('Signature'),
'active': fields.boolean('Active'),
'action_id': fields.many2one('ir.actions.actions', 'Home Action', help="If specified, this action will be opened at log on for this user, in addition to the standard menu."),
'groups_id': fields.many2many('res.groups', 'res_groups_users_rel', 'uid', 'gid', 'Groups'),