diff options
| author | Christophe Matthieu <chm@openerp.com> | 2013-02-15 12:19:26 +0100 |
|---|---|---|
| committer | Christophe Matthieu <chm@openerp.com> | 2013-02-15 12:19:26 +0100 |
| commit | 093f3a12f266776f11e69bbcdf2dbf926a5482cb (patch) | |
| tree | 525116286950ae6d65f6999a9aceca0eb2bcc35e /addons/mail/static/src | |
| parent | 2ffa8c7979b469312cb8c0ceb408300a9d4069f0 (diff) | |
[FIX] mail_followers: display_subtypes
bzr revid: chm@openerp.com-20130215111926-tpnwii4a3of1gkb7
Diffstat (limited to 'addons/mail/static/src')
| -rw-r--r-- | addons/mail/static/src/js/mail_followers.js | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/addons/mail/static/src/js/mail_followers.js b/addons/mail/static/src/js/mail_followers.js index 03351c24ac2..41634fd2135 100644 --- a/addons/mail/static/src/js/mail_followers.js +++ b/addons/mail/static/src/js/mail_followers.js @@ -206,21 +206,23 @@ openerp_mail_followers = function(session, mail) { /** Fetch subtypes, only if current user is follower */ fetch_subtypes: function () { + var self = this; var subtype_list_ul = this.$('.oe_subtype_list').empty(); if (! this.message_is_follower) return; - var context = new session.web.CompoundContext(this.build_context(), {}); - this.ds_model.call('message_get_subscription_data', [[this.view.datarecord.id], context]).then(this.proxy('display_subtypes')); + var id = this.view.datarecord.id; + this.ds_model.call('message_get_subscription_data', [[id], new session.web.CompoundContext(this.build_context(), {})]) + .then(function (data) {self.display_subtypes(data, id);}); }, /** Display subtypes: {'name': default, followed} */ - display_subtypes:function (data) { + display_subtypes:function (data, id) { var self = this; var subtype_list_ul = this.$('.oe_subtype_list'); var records = []; var nb_subtype = 0; subtype_list_ul.empty(); - if (this.view.datarecord.id) { - records = data[this.view.datarecord.id].message_subtype_data; + if (data[id]) { + records = data[id].message_subtype_data; } _(records).each(function (record) {nb_subtype++;}); if (nb_subtype > 1) { |
