Xavier ALT (OpenERP) has proposed merging 
lp:~openerp-dev/openobject-client-web/6.0-opw-577281-xal 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-577281-xal/+merge/116636

Hi,

This fix a problem when appling attrs to list button when field names are not 
suffixed by "table name".

Steps:
- Go to Warehouse / Tracability / Stock Moves
- Edit one line and assign a "Product Lot"
- Save

Current: button "Splits in production lots" is visible
Expected: button "Splits in production lots" should hide

Regards,
Xavier
-- 
https://code.launchpad.net/~openerp-dev/openobject-client-web/6.0-opw-577281-xal/+merge/116636
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-client-web/6.0-opw-577281-xal.
=== modified file 'addons/openerp/static/javascript/form_state.js'
--- addons/openerp/static/javascript/form_state.js	2012-07-19 13:16:48 +0000
+++ addons/openerp/static/javascript/form_state.js	2012-07-25 12:44:19 +0000
@@ -213,7 +213,14 @@
                 if (parent_table_id && parent_table_id.match('_grid$')) {
                     parent_table_id = parent_table_id.slice(0, parent_table_id.length - 5);
                 }
-                var parent_relative_fieldname = '[name=_terp_listfields/' + parent_table_id + '/' + prefix + ex[0] + ']';
+                if (parent_table_id == '_terp_list') {
+                    // in case list name if '_terp_list' this means we're not inside a o2m/m2m fields,
+                    // and we no need need to prefix with parent_table_id name
+                    parent_table_id = ''
+                } else {
+                    parent_table_id = parent_table_id + '/'
+                }
+                var parent_relative_fieldname = '[name=_terp_listfields/' + parent_table_id + prefix + ex[0] + ']';
                 elem = parent.find(parent_relative_fieldname);
             }
         }

_______________________________________________
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