Foram Katharotiya (OpenERP) has proposed merging 
lp:~openerp-dev/openobject-addons/trunk-message-sub-type-apa-default_subtype-fka
 into lp:~openerp-dev/openobject-addons/trunk-message-sub-type-apa.

Requested reviews:
  Amit Patel (OpenERP) (apa-tiny)

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-message-sub-type-apa-default_subtype-fka/+merge/121547

Hello sir,

  Display default true value in subtype as readonly 

Thanks,
FKA
-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-message-sub-type-apa-default_subtype-fka/+merge/121547
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-addons/trunk-message-sub-type-apa.
=== modified file 'mail/static/src/js/mail_followers.js'
--- mail/static/src/js/mail_followers.js	2012-08-27 05:55:39 +0000
+++ mail/static/src/js/mail_followers.js	2012-08-28 07:22:24 +0000
@@ -44,12 +44,7 @@
             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 @@
         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 @@
                 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

=== modified file 'mail/static/src/xml/mail_followers.xml'
--- mail/static/src/xml/mail_followers.xml	2012-08-27 05:55:39 +0000
+++ mail/static/src/xml/mail_followers.xml	2012-08-28 07:22:24 +0000
@@ -40,7 +40,8 @@
                     <a t-attf-href="#model=mail.message.subtype&amp;id=#{record.id}"><t t-raw="record.name"/></a>
                 </td>
                 <td width="10%">
-                    <input type="checkbox" t-att-id="record.id" t-att-name="record.name" class="oe_msg_subtype_check"/>
+                    <t t-if ="record.default"><input type="checkbox" t-att-id="record.id" t-att-name="record.name"  checked="" class="oe_msg_subtype_check" disabled="disabled"/></t>
+                    <t t-if ="! record.default"><input type="checkbox" t-att-id="record.id" t-att-name="record.name"  class="oe_msg_subtype_check"/></t>
                 </td>
             </tr>
         </table>

_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help   : https://help.launchpad.net/ListHelp

Reply via email to