diff options
| author | Christophe Matthieu <chm@openerp.com> | 2013-01-03 09:57:32 +0100 |
|---|---|---|
| committer | Christophe Matthieu <chm@openerp.com> | 2013-01-03 09:57:32 +0100 |
| commit | 992dbb2fbf6b0e2f2c1f30901402e2ef76ae52b0 (patch) | |
| tree | 46b692590897ad05a3641f1230ba02fdf44f5ba4 | |
| parent | ea7f6f281351873c7813163dacc2b2695abba6b5 (diff) | |
[IMP] mail invite: add signature in invite and not in mail_mail
bzr revid: chm@openerp.com-20130103085732-p329g28wrslplfq3
| -rw-r--r-- | addons/mail/mail_mail.py | 4 | ||||
| -rw-r--r-- | addons/mail/wizard/invite.py | 9 |
2 files changed, 8 insertions, 5 deletions
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 |
