From 32002a68527caa2234c747157b9c3cb9a06c1a24 Mon Sep 17 00:00:00 2001 From: Fabien Pinckaers Date: Mon, 4 Jun 2012 23:00:31 +0200 Subject: [PATCH] [FIX] layouting of groups when row with too fee cols bzr revid: fp@tinyerp.com-20120604210031-omhqeaim4g4gogsj --- addons/web/static/src/js/view_form.js | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index 810eef6..f1115de 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -1136,6 +1136,7 @@ instance.web.form.FormRenderingEngine = instance.web.form.FormRenderingEngineInt $td.addClass('oe_vertical_separator').attr('width', '1'); $td.empty(); row_cols-= $td.attr('colspan') || 1; + total--; } break; case 'label': @@ -1158,20 +1159,22 @@ instance.web.form.FormRenderingEngine = instance.web.form.FormRenderingEngineInt } $td.attr('width', width); $child.removeAttr('width'); + row_cols-= $td.attr('colspan') || 1; } else { to_compute.push($td); } - row_cols-= $td.attr('colspan') || 1; } }); - var unit = Math.floor(total / row_cols); - if (!row_cols && !$(this).is('.oe_form_group_row_incomplete')) { - _.each(to_compute, function($td, i) { - var width = parseInt($td.attr('colspan'), 10) * unit; - $td.attr('width', ((i == to_compute.length - 1) ? total : width) + '%'); - total -= width; - }); + if (row_cols) { + var unit = Math.floor(total / row_cols); + if (!$(this).is('.oe_form_group_row_incomplete')) { + _.each(to_compute, function($td, i) { + var width = parseInt($td.attr('colspan'), 10) * unit; + $td.attr('width', width + '%'); + total -= width; + }); + } } }); _.each(children, function(el) { -- 1.7.10.4