[FIX] FIxed bug when unsubscribing; state was not cleanly refreshed.

bzr revid: tde@openerp.com-20120328120126-c504uue3l2v3olra
This commit is contained in:
Thibault Delavallée 2012-03-28 14:01:26 +02:00
parent 206995738c
commit fd784085da
1 changed files with 2 additions and 1 deletions

View File

@ -479,6 +479,7 @@ openerp.mail = function(session) {
display_subscribers: function (records) {
var self = this;
this.is_subscriber = false;
var sub_node = this.$element.find('div.oe_mail_recthread_followers')
sub_node.empty();
$('<h4/>').html('Followers (' + records.length + ')').appendTo(sub_node);
@ -502,7 +503,7 @@ openerp.mail = function(session) {
do_unfollow: function () {
var self = this;
return this.ds.call('message_unsubscribe', [[this.view.datarecord.id]]).then(function (record) {
self.do_notify("Impossible to unsubscribe", "You are automatically subscribed to this record. You cannot unsubscribe.");
if (record == false) self.do_notify("Impossible to unsubscribe", "You are automatically subscribed to this record. You cannot unsubscribe.");
}).pipe(this.proxy('fetch_subscribers'));
},