From 033ddaa534a0b0f1f068783bc41db92828ed457c Mon Sep 17 00:00:00 2001 From: "Sanjay Gohel (Open ERP)" Date: Fri, 7 Sep 2012 17:42:58 +0530 Subject: [PATCH] [IMP]improve code bzr revid: sgo@tinyerp.com-20120907121258-r48mymwh9yvxlrqi --- addons/mail/static/src/js/mail_followers.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/addons/mail/static/src/js/mail_followers.js b/addons/mail/static/src/js/mail_followers.js index 53f2117fa04..c2d4f31c159 100644 --- a/addons/mail/static/src/js/mail_followers.js +++ b/addons/mail/static/src/js/mail_followers.js @@ -117,8 +117,9 @@ openerp_mail_followers = function(session, mail) { follower_read.then(function (follower_record){ if(follower_record.length != 0){ _(follower_record[0].subtype_ids).each(function (subtype_id){ - if(self.$el.find('.oe_msg_subtype_check[id=' + subtype_id + ']')[0]){ - self.$el.find('.oe_msg_subtype_check[id=' + subtype_id + ']')[0].checked=true} + var subtype_check = self.$el.find('.oe_msg_subtype_check[id=' + subtype_id + ']') + if(subtype_check.length > 0){ + subtype_check[0].checked=true} }); } })