diff --git a/addons/web/static/src/css/base.css b/addons/web/static/src/css/base.css index 6b334f10c15..fac12098f17 100644 --- a/addons/web/static/src/css/base.css +++ b/addons/web/static/src/css/base.css @@ -347,3 +347,31 @@ width: 100%; white-space: nowrap; } +.openerp2 .oe_form_group_cell { + position: relative; +} +.openerp2 .oe_form_group_cell .oe_field_char, .openerp2 .oe_form_group_cell .oe_form_field_selection select { + width: 99%; +} +.openerp2 .oe_form_group_cell .oe_form_field_selection select { + min-width: 90px; +} +.openerp2 .oe_layout_debugging .oe_form_group { + border: 1px solid red; +} +.openerp2 .oe_layout_debugging .oe_form_group_cell { + border: 1px solid blue; +} +.openerp2 .oe_layout_debugging .oe_layout_debug_cell { + position: absolute; + color: white; + bottom: 0; + left: 0; + background: green; +} +.openerp2 .oe_layout_debugging .oe_layout_debug_cell { + display: block; +} +.openerp2 .oe_layout_debug_cell { + display: none; +} diff --git a/addons/web/static/src/css/base.sass b/addons/web/static/src/css/base.sass index fe9408c18a1..9a77d14558e 100644 --- a/addons/web/static/src/css/base.sass +++ b/addons/web/static/src/css/base.sass @@ -340,6 +340,27 @@ $colour4: #8a89ba .oe_form_button width: 100% white-space: nowrap + .oe_form_group_cell + position: relative + .oe_field_char, .oe_form_field_selection select + width: 99% + .oe_form_field_selection select + min-width: 90px + .oe_layout_debugging + .oe_form_group + border: 1px solid red + .oe_form_group_cell + border: 1px solid blue + .oe_layout_debug_cell + position: absolute + color: white + bottom: 0 + left: 0 + background: green + .oe_layout_debug_cell + display: block + .oe_layout_debug_cell + display: none // }}} .openerp diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index 32660fc5c52..ec82cff76fc 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -767,6 +767,17 @@ openerp.web.FormRenderingEngine = openerp.web.Widget.extend({ w.replace($elem); } }); + $('').appendTo(this.$element).click(this.do_toggle_layout_debugging); + }, + do_toggle_layout_debugging: function() { + if (!this.$element.has('.oe_layout_debug_cell:first').length) { + this.$element.find('.oe_form_group_cell').each(function() { + var $span = $('').text($(this).attr('width')); + $span.prependTo($(this)); + }); + } + this.$element.toggleClass('oe_layout_debugging'); + }, process_field: function($field, $form) { var name = $field.attr('name'), diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml index 069f48fb48e..3f5e067285c 100644 --- a/addons/web/static/src/xml/base.xml +++ b/addons/web/static/src/xml/base.xml @@ -948,7 +948,7 @@