← Back to team overview

c2c-oerpscenario team mailing list archive

[Bug 512237] Re: Colspan handling broken

 

** Changed in: openobject-client-web
       Status: New => Triaged

-- 
You received this bug notification because you are a member of C2C
OERPScenario, which is subscribed to the OpenERP Project Group.
https://bugs.launchpad.net/bugs/512237

Title:
  Colspan handling broken

Status in OpenObject Web Client:
  Triaged

Bug description:
  Goal: get a 20/80 layout (a left sidebar and content of the right).

Create a view with two groups, give one a colspan of 2 and the second one a colspan of 8.

Observe that both groups take half the viewport, and tha their cell widths are set to 20% (correct) and 10% (not correct) respectively.

Issue is in addons/openerp/widgets/form/_form.py: max_width is computed as the maximum number of cells in a row of a table (in this case, 2), and then the width of a given cell (in colspans) is set to 1 if it's above max_width.

In this case, the first cell gets a colspan of 2 indeed (as 2 <= 2), but the second cell is above the limit and gets a colspan of 1 (instead of 8).

Patch attached computes max_length based on colspans (default: 1/cell if not set), doesn't seem to break any layout from a few checks but I'm not sure there aren't any views relying on the former behavior.