[FIX] Followers widget: fixed is_follower bug.

bzr revid: tde@openerp.com-20120920073950-wyrf8pads5j6hgqh
This commit is contained in:
Thibault Delavallée
2012-09-20 09:39:50 +02:00
parent cae00c851a
commit 52b33a8044
+7 -7
View File
@@ -72,24 +72,24 @@ openerp_mail_followers = function(session, mail) {
read_value: function() {
var self = this;
return this.ds_model.read_ids([this.view.datarecord.id], ['message_follower_ids']).pipe(function (results) {
return results[0].message_follower_ids;
}).pipe(this.proxy('set_value'));
return this.ds_model.read_ids([this.view.datarecord.id], ['message_is_follower', 'message_follower_ids']).then(function (results) {
self.set_value(results[0].message_follower_ids, results[0].message_is_follower);
});
},
set_value: function(value_) {
set_value: function(value_, message_is_follower) {
this.reinit();
if (! this.view.datarecord.id ||
session.web.BufferedDataSet.virtual_id_regex.test(this.view.datarecord.id)) {
this.$('div.oe_mail_recthread_aside').hide();
return;
}
return this.fetch_followers(value_ || this.get_value());
return this.fetch_followers(value_ || this.get_value(), message_is_follower);
},
fetch_followers: function (value_) {
fetch_followers: function (value_, message_is_follower) {
this.value = value_;
this.message_is_follower = this.getParent().fields.message_is_follower && this.getParent().fields.message_is_follower.get_value();
this.message_is_follower = message_is_follower || (this.getParent().fields.message_is_follower && this.getParent().fields.message_is_follower.get_value());
return this.ds_follow.call('read', [value_, ['name', 'user_ids']]).pipe(this.proxy('display_followers'), this.proxy('display_generic'));
},