Bhumi Thakkar (Open ERP) has proposed merging 
lp:~openerp-dev/openerp-web/trunk-improve-css-FF-IE-button-action-object-bth 
into lp:~openerp-dev/openerp-web/trunk-improve-css-FF-IE.

Requested reviews:
  OpenERP R&D Team (openerp-dev)

For more details, see:
https://code.launchpad.net/~openerp-dev/openerp-web/trunk-improve-css-FF-IE-button-action-object-bth/+merge/126607

Hello,
 
      In IE browser, button is not working properly when action is perform 
based on button type it will not not work.
E.G:
1.In Purchase => Purchase Order => Open any record => click on button Invite => 
then click on Add Followers button => nothing happen.
2.In Manufacturing => Manufacturing order => Open any record => in consumed 
products tab click on consume products button => dialog not closed after click 
on 'ok' button.
3. In Human Resource => Recruitment => Applications => open any record => click 
on start interview or print interview button => nothing happen.
4. In Point of sale => Daily Operations => click on button New session  (any 
button) => Nothing happen.

In IE browser, for button submit type is by default. so it is render with type 
of submit so it will not perform any if it is action or object. So get all 
buttons from arch and get attributes and set attribute of type with attribute 
of arch.

Thanks.
-- 
https://code.launchpad.net/~openerp-dev/openerp-web/trunk-improve-css-FF-IE-button-action-object-bth/+merge/126607
Your team OpenERP R&D Team is requested to review the proposed merge of 
lp:~openerp-dev/openerp-web/trunk-improve-css-FF-IE-button-action-object-bth 
into lp:~openerp-dev/openerp-web/trunk-improve-css-FF-IE.
=== modified file 'addons/web/static/src/js/coresetup.js'
--- addons/web/static/src/js/coresetup.js	2012-09-14 16:12:46 +0000
+++ addons/web/static/src/js/coresetup.js	2012-09-27 06:51:24 +0000
@@ -3,7 +3,13 @@
  *--------------------------------------------------------*/
 var console;
 if (!console) {
-    console = {log: function () {}};
+    console = {};
+    var noop = function () {};
+    _.each('log error debug info warn assert clear dir dirxml trace group \
+            groupCollapsed groupEnd time timeEnd profile profileEnd count \
+            exception'.split(/\s+/), function (property) {
+        console[property] = noop;
+    });
 }
 if (!console.debug) {
     console.debug = console.log;

=== modified file 'addons/web/static/src/js/view_form.js'
--- addons/web/static/src/js/view_form.js	2012-09-26 05:40:55 +0000
+++ addons/web/static/src/js/view_form.js	2012-09-27 06:51:24 +0000
@@ -1148,6 +1148,7 @@
         this.process_version();
 
         this.fields_to_init = [];
+        this.buttons = [];
         this.tags_to_init = [];
         this.labels = {};
         this.process(this.$form);
@@ -1172,7 +1173,8 @@
             self.view.register_field(w, $elem.attr("name"));
             w.replace($elem);
         });
-        _.each(this.tags_to_init, function($elem) {
+        _.each(this.tags_to_init, function($elem, k) {
+            if(self.buttons[k].type) $elem[0].setAttribute("type", self.buttons[k].type)
             var tag_name = $elem[0].tagName.toLowerCase();
             var obj = self.tags_registry.get_object(tag_name);
             var w = new (obj)(self.view, instance.web.xml_to_json($elem[0]));
@@ -1198,10 +1200,25 @@
         }
         this.$target.toggleClass('oe_layout_debugging');
     },
+    get_button_json: function(obj, child){
+        this.buttons = child || [];
+        if (obj.children && obj.children.length) {
+            for (var i = 0, ii = obj.children.length; i < ii; i++) {
+                if(obj.children[i].tag=="button"){
+                    this.buttons.push(obj.children[i].attrs)
+                }
+                if(obj.children[i].children){
+                    this.get_button_json(obj.children[i], this.buttons)
+                }
+            }
+            return this.buttons;
+        }
+    },
     process: function($tag) {
         var self = this;
         var tagname = $tag[0].nodeName.toLowerCase();
         if (this.tags_registry.contains(tagname)) {
+            this.get_button_json(this.fvg.arch)
             this.tags_to_init.push($tag);
             return $tag;
         }

_______________________________________________
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