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.

21 lines
738 B

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