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):
#
##############################################################################
+from openerp import tools
from openerp.osv import osv
from openerp.osv import fields
from openerp.tools.translate import _
# 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
'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