summaryrefslogtreecommitdiff
path: root/addons/mail/wizard/invite.py
diff options
context:
space:
mode:
authorJérome Maes <jem@openerp.com>2015-09-03 13:52:57 +0200
committerJérome Maes <jem@openerp.com>2015-09-04 15:55:46 +0200
commit4bdfa3b6caefc6621d7043738708a766b4f80f69 (patch)
treeafb6edf03b57ac7dcc34ae84bb1d7266e6c93eb2 /addons/mail/wizard/invite.py
parent7674536713aaa3721ddb55e43ddf50585a4f20a0 (diff)
[IMP] mail : invite follower wizard have 2 appearances
The wizard is the same object, but to add channel as follower, some fields was not required. Via the 'mail_invite_follower_channel_only' context key, the unrelevant fields are hidden.
Diffstat (limited to 'addons/mail/wizard/invite.py')
-rw-r--r--addons/mail/wizard/invite.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/addons/mail/wizard/invite.py b/addons/mail/wizard/invite.py
index 8ad772a04cc..36736cb355d 100644
--- a/addons/mail/wizard/invite.py
+++ b/addons/mail/wizard/invite.py
@@ -5,7 +5,7 @@ from openerp import tools
class Invite(models.TransientModel):
- """ Wizard to invite partners and make them followers. """
+ """ Wizard to invite partners (or channels) and make them followers. """
_name = 'mail.wizard.invite'
_description = 'Invite wizard'
@@ -15,6 +15,8 @@ class Invite(models.TransientModel):
user_name = self.env.user.name_get()[0][1]
model = result.get('res_model')
res_id = result.get('res_id')
+ if self._context.get('mail_invite_follower_channel_only'):
+ result['send_mail'] = False
if 'message' in fields and model and res_id:
model_name = self.env['ir.model'].search([('model', '=', self.pool[model]._name)]).name_get()[0][1]
document_name = self.env[model].browse(res_id).name_get()[0][1]