diff options
| author | Jérome Maes <jem@openerp.com> | 2015-09-03 13:52:57 +0200 |
|---|---|---|
| committer | Jérome Maes <jem@openerp.com> | 2015-09-04 15:55:46 +0200 |
| commit | 4bdfa3b6caefc6621d7043738708a766b4f80f69 (patch) | |
| tree | afb6edf03b57ac7dcc34ae84bb1d7266e6c93eb2 /addons/mail/static/src | |
| parent | 7674536713aaa3721ddb55e43ddf50585a4f20a0 (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/static/src')
| -rw-r--r-- | addons/mail/static/src/js/mail_followers.js | 13 | ||||
| -rw-r--r-- | addons/mail/static/src/xml/mail_followers.xml | 3 |
2 files changed, 13 insertions, 3 deletions
diff --git a/addons/mail/static/src/js/mail_followers.js b/addons/mail/static/src/js/mail_followers.js index 630e033de0f..3e83831b478 100644 --- a/addons/mail/static/src/js/mail_followers.js +++ b/addons/mail/static/src/js/mail_followers.js @@ -94,7 +94,14 @@ var Followers = form_common.AbstractField.extend({ }); // event: click on 'invite' button, that opens the invite wizard - this.$el.on('click', '.o_add_follower', self.on_invite_follower); + this.$el.on('click', '.o_add_follower', function(e){ + e.preventDefault(); + self.on_invite_follower(false); + }); + this.$el.on('click', '.o_add_follower_channel', function(e){ + e.preventDefault(); + self.on_invite_follower(true); + }); // event: click on 'edit_subtype(pencil)' button to edit subscription this.$el.on('click', '.o_edit_subtype', self.on_edit_subtype); @@ -126,9 +133,8 @@ var Followers = form_common.AbstractField.extend({ return self.fetch_subtypes(user_pid); }, - on_invite_follower: function (event) { + on_invite_follower: function (channel_only) { var self = this; - event.preventDefault(); var action = { type: 'ir.actions.act_window', res_model: 'mail.wizard.invite', @@ -140,6 +146,7 @@ var Followers = form_common.AbstractField.extend({ context: { 'default_res_model': this.view.dataset.model, 'default_res_id': this.view.datarecord.id, + 'mail_invite_follower_channel_only': channel_only, }, }; this.do_action(action, { diff --git a/addons/mail/static/src/xml/mail_followers.xml b/addons/mail/static/src/xml/mail_followers.xml index 059f67797bf..6370715695a 100644 --- a/addons/mail/static/src/xml/mail_followers.xml +++ b/addons/mail/static/src/xml/mail_followers.xml @@ -54,6 +54,9 @@ <li t-if="widget.view_is_editable" class="o_add_follower"> <a href="#"> Add followers </a> </li> + <li t-if="widget.view_is_editable" class="o_add_follower_channel"> + <a href="#"> Add Channels </a> + </li> <li t-if="widget.view_is_editable and (widget.followers.length > 0)" class="divider"/> </t> |
