From 0f8274ffa30acf585dbd7359c0e9872727a8663d Mon Sep 17 00:00:00 2001 From: "Foram Katharotiya (OpenERP)" Date: Tue, 28 Aug 2012 12:49:06 +0530 Subject: [PATCH] [IMP] Display Default value of subtype bzr revid: fka@tinyerp.com-20120828071906-cdoh84qlie1si73t --- addons/mail/static/src/js/mail_followers.js | 18 +++++++++++------- addons/mail/static/src/xml/mail_followers.xml | 3 ++- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/addons/mail/static/src/js/mail_followers.js b/addons/mail/static/src/js/mail_followers.js index f81919de1c7..cfbff3744aa 100644 --- a/addons/mail/static/src/js/mail_followers.js +++ b/addons/mail/static/src/js/mail_followers.js @@ -44,12 +44,7 @@ openerp_mail_followers = function(session, mail) { this._check_visibility(); this.fetch_subtype(); this.$el.find('div.oe_mail_recthread_subtype').click(function () { - var subtypelist = new Array(); - _($(this).find('.oe_msg_subtype_check')).each(function (record){ - if($(record).is(':checked')) { - subtypelist.push(parseInt($(record).attr('id')))} - }); - self.ds_model.call('message_subscribe_udpate_subtypes',[[self.view.datarecord.id],self.session.uid,subtypelist]) + self.update_subtype(); }) this.$el.find('button.oe_mail_button_followers').click(function () { self.do_toggle_followers(); }); @@ -108,6 +103,7 @@ openerp_mail_followers = function(session, mail) { display_subscribers: function (records) { var self = this; this.is_subscriber = false; + if(this.view.get("actual_mode") == "edit"){this.update_subtype();} var user_list = this.$el.find('ul.oe_mail_followers_display').empty(); this.$el.find('div.oe_mail_recthread_followers h4').html(this.params.title + ' (' + records.length + ')'); _(records).each(function (record) { @@ -124,7 +120,15 @@ openerp_mail_followers = function(session, mail) { this.$el.find('button.oe_mail_button_unfollow').hide(); this.$el.find('div.oe_mail_recthread_subtype').hide() } }, - + update_subtype: function (){ + var self = this; + var cheklist = new Array(); + _(this.$el.find('.oe_msg_subtype_check')).each(function(record){ + if($(record).is(':checked')) { + cheklist.push(parseInt($(record).attr('id')))} + }); + self.ds_model.call('message_subscribe_udpate_subtypes',[[self.view.datarecord.id],self.session.uid,cheklist]) + }, // Display the subtypes of each records. display_subtype: function(records) { var self = this diff --git a/addons/mail/static/src/xml/mail_followers.xml b/addons/mail/static/src/xml/mail_followers.xml index 2f7f5e6cde8..d307aff7b19 100644 --- a/addons/mail/static/src/xml/mail_followers.xml +++ b/addons/mail/static/src/xml/mail_followers.xml @@ -40,7 +40,8 @@ - + +