diff options
| author | Christophe Matthieu <chm@openerp.com> | 2012-09-24 12:11:08 +0200 |
|---|---|---|
| committer | Christophe Matthieu <chm@openerp.com> | 2012-09-24 12:11:08 +0200 |
| commit | ac7adf29d2e59a9dc31e4c59b0969b448bb5742e (patch) | |
| tree | ebc3d9baaec4cda951ac6a6bd44b36a74734a016 | |
| parent | 278faf5f306c68395cfddc45575847cd0ba341a8 (diff) | |
[IMP] mail_follower: unfollow when no subtypes following
bzr revid: chm@openerp.com-20120924101108-iyhv21w0zkvzb4jb
| -rw-r--r-- | addons/mail/static/src/js/mail_followers.js | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/addons/mail/static/src/js/mail_followers.js b/addons/mail/static/src/js/mail_followers.js index a3ba6f91a04..85bd4c37987 100644 --- a/addons/mail/static/src/js/mail_followers.js +++ b/addons/mail/static/src/js/mail_followers.js @@ -85,7 +85,6 @@ openerp_mail_followers = function(session, mail) { }, set_value: function(value_) { - console.log("set_value", value_); this.reinit(); return this.fetch_followers(value_ || this.get_value()); }, @@ -209,8 +208,11 @@ openerp_mail_followers = function(session, mail) { if($(record).is(':checked')) { checklist.push(parseInt($(record).data('id')))} }); - - return this.ds_model.call('message_subscribe_users',[[self.view.datarecord.id], undefined, checklist, context]).pipe(this.proxy('read_value')); + + if(!checklist.length) + return this.do_unfollow(); + else + return this.ds_model.call('message_subscribe_users',[[self.view.datarecord.id], undefined, checklist, context]).pipe(this.proxy('read_value')); }, }); |
