diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index 21c3b3f43d9..31fadc789d4 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -1189,36 +1189,19 @@ instance.web.form.FormRenderingEngine = instance.web.form.FormRenderingEngineInt }); } }, - view_arch_to_dom_node: function(arch) { - // Historic mess for views arch - // - // server: - // -> got xml as string - // -> parse to xml and manipulate domains and contexts - // -> convert to json - // client: - // -> got view as json - // -> convert back to xml as string - // -> parse it as xml doc (manipulate button@type for IE) - // -> convert back to string - // -> parse it as dom element with jquery - // -> for each widget, convert node to json - // - // Wow !!! - var xml = instance.web.json_node_to_xml(arch); - - var doc = $.parseXML('
' + xml + '
'); + get_arch_fragment: function() { + var doc = this.fvg.arch_doc.documentElement.cloneNode(true); + // IE won't allow custom button@type and will revert it to spec default : 'submit' $('button', doc).each(function() { $(this).attr('data-button-type', $(this).attr('type')).attr('type', 'button'); }); - xml = instance.web.xml_to_str(doc); - return $(xml); + return $('
').append(doc); }, render_to: function($target) { var self = this; this.$target = $target; - this.$form = this.view_arch_to_dom_node(this.fvg.arch); + this.$form = this.get_arch_fragment(); this.process_version();