Hiding separator tag if no items under

Rational

Sometimes a separator tag is added on a form view for meaningful purpose. For instance, we could have a “shipment” separator in the “sale” tab on the “party” form.
But it’s complicated if you want to add fields under this tag from distinct modules. You have to add a dependency between those modules (even if they are not) to add new field at the correct place.

Proposal

Allowing to add separator tag at an higher level (i mean in a common module required by all modules that needs this separator) and hiding this separator if there’s no items under… Something equivalent to the process applied on empty pages (trytond: 5797b992383d trytond/model/modelview.py). Except that separator tag has no children like page tag.

Implementation

I do not think that we must consider that the tags after a separator are linked to it.
Indeed the usage of separator has never been clean because we use is to group but there is no semantic about what is grouped.
Maybe we should allow to fill a separator with tags but they are rendered in the same container. This way we could hide separator if they are empty.

2 Likes

What you describe sounds like using a group with a string attached to it and the same colspan/cols as its container. So I’m wondering if it won’t be easier to use groups instead of separators.

Or at least we should have the same hidding mechanism for groups and also for separators.

So probably the same behaviour sho

No because they would not have the same column widths.