diff options
| author | Thibault Delavallée <tde@openerp.com> | 2012-03-29 12:11:13 +0200 |
|---|---|---|
| committer | Thibault Delavallée <tde@openerp.com> | 2012-03-29 12:11:13 +0200 |
| commit | 445a8bfe51f3c0eea7c6badcc03621617f9cc59e (patch) | |
| tree | c5c8ee6eee5405049dfc767557f5cb1d2e4009b2 | |
| parent | 3c67eb22977fc0dd7a780fb7a0a5a1322e48dc22 (diff) | |
[IMP] res.users in mail: added a welcome message when creating a new user. A broadcasting mechanism will be necessaryu though.
bzr revid: tde@openerp.com-20120329101113-5qg2hqbdawln56yh
| -rw-r--r-- | addons/mail/res_users.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/addons/mail/res_users.py b/addons/mail/res_users.py index db0f4ac89b8..f5de133c607 100644 --- a/addons/mail/res_users.py +++ b/addons/mail/res_users.py @@ -45,8 +45,13 @@ class res_users(osv.osv): def create(self, cr, uid, data, context=None): user_id = super(res_users, self).create(cr, uid, data, context=context) + user = self.browse(cr, uid, [user_id], context=context)[0] # make user follow itself self.message_subscribe(cr, uid, [user_id], [user_id], context=context) + # create a welcome message to broadcast + company_name = user.company_id.name if user.company_id else 'the company' + message = _('%s has joined %s! You may leave him a message to celebrate his arrival and help him doing its first steps !') % (user.name, company_name) + self.message_append_note(cr, uid, [user.id], 'Welcome notification', message, context=context) return user_id def message_load_ids(self, cr, uid, ids, limit=100, offset=0, domain=[], ascent=False, root_ids=[False], context=None): |
