Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0047923Openbravo ERP00. Application dictionarypublic2021-10-22 13:202021-11-17 00:28
alostale 
ablasco 
normalmajorhave not tried
closedfixed 
5
 
PR22Q1 
Core
No
0047923: broken field layout when different modules add fields to the same tab
When there are several modules adding fields to the same tab, the field layout can easily get broken.

The main reason is fields only take into account their seqno value to get sorted.

Given a tab with the following fields and field groups:

seqNo | Fld | FldGrp
------+-----+--------
  100 | a   | A
  110 | b   | (null)  
  120 | c   | B
  130 | d   | A 
  140 | e   | (null)


The tab would be rendered as:

A ----------
a  
b

B ----------
c

A ----------
d
e
Prevent splitting a field group in different pieces.

The previous case should be rendered as:

A ----------
a
b
d

B ----------
c
e



To achieve this, change the algorithm to sort fields to:

1. Sort fields by seqNo until the next field group
2. Within a field group sort by seqNo
3. Fields without a field group are considered part of the current field group
4. When there is a field with a different field group: look for other fields with the current field group with a higher sequence, add them before the new field group
5. Add the field with the new field group
6. Repeat from step 1 till there are no more fields in the tab

No tags attached.
png multi-fld-grp.png (60,941) 2021-10-25 10:10
https://issues.openbravo.com/file_download.php?file_id=16296&type=bug
png
Issue History
2021-10-22 13:20alostaleNew Issue
2021-10-22 13:20alostaleAssigned To => platform
2021-10-22 13:20alostaleModules => Core
2021-10-22 13:20alostaleTriggers an Emergency Pack => No
2021-10-22 13:26alostaleProposed Solution updated
2021-10-22 13:27alostaleProposed Solution updated
2021-10-25 10:10alostaleFile Added: multi-fld-grp.png
2021-10-26 12:06AugustoMauchStatusnew => acknowledged
2021-10-26 12:06AugustoMauchAssigned Toplatform => ablasco
2021-10-26 12:06AugustoMauchStatusacknowledged => scheduled
2021-11-10 12:49hgbotNote Added: 0132931
2021-11-17 00:28hgbotResolutionopen => fixed
2021-11-17 00:28hgbotStatusscheduled => closed
2021-11-17 00:28hgbotNote Added: 0133127
2021-11-17 00:28hgbotFixed in Version => PR22Q1
2021-11-17 00:28hgbotNote Added: 0133128

Notes
(0132931)
hgbot   
2021-11-10 12:49   
Merge Request created: https://gitlab.com/openbravo/product/openbravo/-/merge_requests/453 [^]
(0133127)
hgbot   
2021-11-17 00:28   
Merge request merged: https://gitlab.com/openbravo/product/openbravo/-/merge_requests/453 [^]
(0133128)
hgbot   
2021-11-17 00:28   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/openbravo [^]
Changeset: 9ff649f03998a3b74f794e673ae8bfa4404d3254
Author: adrian.blasco <adrian.blasco@openbravo.com>
Date: 2021-11-17T00:27:27+01:00
URL: https://gitlab.com/openbravo/product/openbravo/-/commit/9ff649f03998a3b74f794e673ae8bfa4404d3254 [^]

Fixes ISSUE-47923: Fieldgroup split prevention in backoffice view generation

---
A modules/org.openbravo.client.application/src-test/org/openbravo/client/application/window/OBViewFieldHandlerFieldSorterTest.java
M modules/org.openbravo.client.application/src/org/openbravo/client/application/window/OBViewFieldHandler.java
M src-test/src/org/openbravo/test/StandaloneTestSuite.java
---