Chirag Patel (OpenERP) has proposed merging 
lp:~openerp-dev/openobject-client-web/6.0-opw-441852-cpa into 
lp:openobject-client-web.

Requested reviews:
  OpenERP Core Team (openerp)

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-client-web/6.0-opw-441852-cpa/+merge/94914

Hello,

Attrs readonly not work when select value from m2o suggestion box.

Change event trigger for the hidden field.

Demo: Accounting > Configuration > Financial Accounting > Accounts > accounts

1. Edit one Chart of accounts.
2. Write "a" in field "Secondary Currency"
3. select one value from suggestion box.

Observed: "Outgoing Currencies Rate" field is in readonly mode.
Expected: "Outgoing Currencies Rate" field should not in readonly mode.

When you click on m2o search img and select one value from popup it's working 
fine.

Thanks.
-- 
https://code.launchpad.net/~openerp-dev/openobject-client-web/6.0-opw-441852-cpa/+merge/94914
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-client-web/6.0-opw-441852-cpa.
=== modified file 'addons/openerp/static/javascript/m2o.js'
--- addons/openerp/static/javascript/m2o.js	2011-08-04 14:07:40 +0000
+++ addons/openerp/static/javascript/m2o.js	2012-02-28 06:59:21 +0000
@@ -31,6 +31,7 @@
     }
 
     this.__init__(name);
+    self = this;
 };
 
 ManyToOne.prototype.__init__ = function(name) {
@@ -65,7 +66,6 @@
     jQuery(this.text).attr('autocomplete', 'OFF');
 
     if(this.editable) {
-        jQuery(this.field).change(jQuery.proxy(this, 'on_change'));
         jQuery(this.text).bind({
             keydown: jQuery.proxy(this, 'on_keydown'),
             keypress: jQuery.proxy(this, 'on_keypress'),
@@ -294,6 +294,7 @@
                 if(this.callback) {
                     onChange(this.name);
                 }
+                $(this.field).change();
                 this.change_icon();
                 this.clearResults();
                 break;
@@ -332,6 +333,7 @@
     if((evt.which == 8 || evt.which == 46) && this.field.value) {
         this.text.value = '';
         this.field.value = '';
+        $(this.field).change();
         this.on_change(evt);
     }
 
@@ -625,6 +627,7 @@
             if($m2o_field[0].onchange) {
                 $m2o_field[0].onchange();
             } else {
+                self.on_change();
                 $m2o_field.change();
             }
         }

_______________________________________________
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