[IMP] Add span with class for footer received in mail

[FIX] convert partner_to  from template_mail (string with comma) to recipent_ids (list of partner_id) in model mail_mail

bzr revid: jke@openerp.com-20131219133144-zbt100e8030wd927
This commit is contained in:
jke-openerp 2013-12-19 14:31:44 +01:00
parent dc7660414a
commit 306dd6e397
3 changed files with 8 additions and 2 deletions

View File

@ -411,7 +411,13 @@ class email_template(osv.osv):
# create a mail_mail based on values, without attachments
values = self.generate_email(cr, uid, template_id, res_id, context=context)
assert values.get('email_from'), 'email_from is missing or empty after template rendering, send_mail() cannot proceed'
recipient_ids = []
for partner_id in (values['partner_to'] and values['partner_to'].split(',') or []):
recipient_ids.append((4,partner_id))
values['recipient_ids'] = recipient_ids
del values['partner_to'] # TODO Properly use them.
attachment_ids = values.pop('attachment_ids', [])
attachments = values.pop('attachments', [])
msg_id = mail_mail.create(cr, uid, values, context=context)

View File

@ -162,7 +162,7 @@ class mail_mail(osv.Model):
fragment.update(model=mail.model, res_id=mail.res_id)
url = urljoin(base_url, "?%s#%s" % (urlencode(query), urlencode(fragment)))
return _("""<small>Access your messages and documents <a style='color:inherit' href="%s">in OpenERP</a></small>""") % url
return _("""<span class='oe_mail_footer_access'><small>Access your messages and documents <a style='color:inherit' href="%s">in OpenERP</a></small></span>""") % url
else:
return None

View File

@ -41,6 +41,6 @@ class mail_mail(osv.Model):
signup_url = partner_obj._get_signup_url_for_action(cr, SUPERUSER_ID, [partner.id],
action='login', model=mail.model, res_id=mail.res_id,
context=contex_signup)[partner.id]
return _("""<small>Access your messages and documents through <a style='color:inherit' href="%s">our Customer Portal</a></small>""") % signup_url
return _("""<span class='oe_mail_footer_access'><small>Access your messages and documents through <a style='color:inherit' href="%s">our Customer Portal</a></small></span>""") % signup_url
else:
return super(mail_mail, self)._get_partner_access_link(cr, uid, mail, partner=partner, context=context)