Colspan handling broken

Bug #512237 reported by Xavier (Open ERP)
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Odoo Web Client
Invalid
Undecided
OpenERP R&D Web Team

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.

Revision history for this message
Xavier (Open ERP) (xmo-deactivatedaccount) wrote :
Revision history for this message
Xavier (Open ERP) (xmo-deactivatedaccount) wrote :

And it turns out that with that modification, max_length isn't very useful anymore I think (it shouldn't be possible for a colspan to be > max_length as colspans are computed from max_length. Unless there are negative colspans somewhere), so it could just as well be removed

Revision history for this message
Amit Mendapara (cristatus) wrote :

Xavier, be careful with that code, it will break web browser compatibility. Try to solve the layout issue by redesigning your form which is causing the issue.

Changed in openobject-client-web:
status: New → Triaged
Revision history for this message
Somesh Khare (somesh.khare) wrote :

We Let the Web-Client team decide.

Thanks.

Changed in openobject-client-web:
assignee: nobody → OpenERP SA's Web Client R&D (openerp-dev-web)
Revision history for this message
Xavier (Open ERP) (xmo-deactivatedaccount) wrote :

Layout probably still partially broken but mostly fixed since this bug was originally created

Changed in openobject-client-web:
status: Triaged → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.