You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
762 B

  1. # -*- coding: utf-8 -*-
  2. from openerp.osv import osv
  3. from openerp import tools, SUPERUSER_ID
  4. class MailNotification(osv.Model):
  5. _inherit = 'mail.notification'
  6. def get_signature_footer(self, cr, uid, user_id, res_model=None, res_id=None, context=None, user_signature=True):
  7. footer = ""
  8. if not user_id:
  9. return footer
  10. # add user signature
  11. user = self.pool.get("res.users").browse(cr, SUPERUSER_ID, [user_id], context=context)[0]
  12. if user_signature:
  13. if user.signature:
  14. signature = user.signature
  15. else:
  16. signature = "--<br />%s" % user.name
  17. footer = tools.append_content_to_html(footer, signature, plaintext=False)
  18. return footer