diff --git a/addons/mail/mail_mail.py b/addons/mail/mail_mail.py index f9fa06db765..d6cb2a2cf7e 100644 --- a/addons/mail/mail_mail.py +++ b/addons/mail/mail_mail.py @@ -78,10 +78,6 @@ class mail_mail(osv.Model): def create(self, cr, uid, values, context=None): if 'notification' not in values and values.get('mail_message_id'): values['notification'] = True - user_id = self.pool.get("res.users").browse(cr, uid, uid, context=context) - signature = user_id and user_id.signature or '' - if signature: - values['body_html'] = tools.append_content_to_html(values['body_html'], signature, plaintext=True, container_tag='div') return super(mail_mail, self).create(cr, uid, values, context=context) def unlink(self, cr, uid, ids, context=None): diff --git a/addons/mail/wizard/invite.py b/addons/mail/wizard/invite.py index ee3053014af..11d072b3063 100644 --- a/addons/mail/wizard/invite.py +++ b/addons/mail/wizard/invite.py @@ -19,6 +19,7 @@ # ############################################################################## +from openerp import tools from openerp.osv import osv from openerp.osv import fields from openerp.tools.translate import _ @@ -60,6 +61,12 @@ class invite_wizard(osv.osv_memory): # send an email if wizard.message: + #add signature + user_id = self.pool.get("res.users").browse(cr, uid, uid, context=context) + signature = user_id and user_id.signature or '' + if signature: + wizard.message = tools.append_content_to_html(wizard.message, signature, plaintext=True, container_tag='div') + # send mail to new followers for follower_id in new_follower_ids: mail_mail = self.pool.get('mail.mail') # the invite wizard should create a private message not related to any object -> no model, no res_id @@ -73,4 +80,4 @@ class invite_wizard(osv.osv_memory): 'model': False, }, context=context) mail_mail.send(cr, uid, [mail_id], recipient_ids=[follower_id], context=context) - return {'type': 'ir.actions.act_window_close'} + return {'type': 'ir.actions.act_window_close'} \ No newline at end of file