From ac7adf29d2e59a9dc31e4c59b0969b448bb5742e Mon Sep 17 00:00:00 2001 From: Christophe Matthieu Date: Mon, 24 Sep 2012 12:11:08 +0200 Subject: [PATCH] [IMP] mail_follower: unfollow when no subtypes following bzr revid: chm@openerp.com-20120924101108-iyhv21w0zkvzb4jb --- addons/mail/static/src/js/mail_followers.js | 8 +++++--- 1 file 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')); }, });