+ alter_field: function(field) {},
+ toggle_layout_debugging: function() {
+ if (!this.$element.has('.oe_layout_debug_cell:first').length) {
+ this.$element.find('.oe_form_group_cell').each(function() {
+ var text = 'W:' + ($(this).attr('width') || '') + ' - C:' + $(this).attr('colspan'),
+ $span = $('<span class="oe_layout_debug_cell"/>').text(text);
+ $span.prependTo($(this));
+ });
+ }
+ this.$element.toggleClass('oe_layout_debugging');
+
+ },
+ process: function($tag) {
+ var self = this;
+ var tagname = $tag[0].nodeName.toLowerCase();
+ var fn = self['process_' + tagname];
+ if (this.registry && this.registry.contains(tagname)) {
+ fn = this.registry.get_object(tagname);
+ }
+ if (fn) {
+ var args = [].slice.call(arguments);
+ args[0] = $tag;
+ return fn.apply(self, args);
+ } else {
+ // generic tag handling, just process children
+ $tag.children().each(function() {
+ self.process($(this));
+ });
+ return $tag;
+ }
+ },
+ process_form: function($form) {
+ var $new_form = this.render_element('FormRenderingForm', $form.getAttributes());
+ $dst = this.legacy_mode ? $new_form.find('group:first') : $new_form;
+ $form.children().appendTo($dst);
+ if ($form[0] === this.$form[0]) {
+ // If root element, replace it
+ this.$form = $new_form;
+ } else {
+ $form.before($new_form).remove();
+ }
+ this.process($new_form);
+ },
+ preprocess_field: function($field) {