Vaibhav (OpenERP) has proposed merging 
lp:~openerp-dev/openerp-web/trunk-bug-869746-vda into lp:openerp-web.

Requested reviews:
  OpenERP R&D Web Team (openerp-dev-web)
Related bugs:
  Bug #869746 in OpenERP Web: "Button is not working :- "Consume 
Product","Split in Lots","Scraps Products""
  https://bugs.launchpad.net/openerp-web/+bug/869746

For more details, see:
https://code.launchpad.net/~openerp-dev/openerp-web/trunk-bug-869746-vda/+merge/78701

Type cast for Action button.
columns contain field action `id|name` as a string but as an Integer on field 
data attributes.
And At last when do_execute_action performs action, parse action.name.



-- 
https://code.launchpad.net/~openerp-dev/openerp-web/trunk-bug-869746-vda/+merge/78701
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openerp-web/trunk-bug-869746-vda.
=== modified file 'addons/web/static/src/js/view_list.js'
--- addons/web/static/src/js/view_list.js	2011-10-07 07:17:56 +0000
+++ addons/web/static/src/js/view_list.js	2011-10-08 08:21:25 +0000
@@ -712,7 +712,11 @@
         this.columns = opts.columns;
         this.dataset = opts.dataset;
         this.records = opts.records;
-
+        
+        this.visible_columns = _.filter(this.columns, function (column) {
+            return column.invisible !== '1';
+        });
+        
         this.record_callbacks = {
             'remove': function (event, record) {
                 var $row = self.$current.find(
@@ -765,8 +769,11 @@
                 var $target = $(e.currentTarget),
                       field = $target.closest('td').data('field'),
                        $row = $target.closest('tr'),
-                  record_id = self.row_id($row);
-
+                       field_action = self.visible_columns[$target.closest('td').index()],
+                    record_id = self.row_id($row);
+                    
+                if(field_action.type == 'action') field = field.toString();
+                
                 $(self).trigger('action', [field, record_id, function () {
                     return self.reload_record(self.records.get(record_id));
                 }]);

_______________________________________________
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