Cannot export windows via 2pack if any field has a Field Group
Description
Environment
Attachments
is caused by

Activity

The isText is an obvious bug that should be addressed.
The replacement of DisplayType.List comparision with isList is a very low risk refactoring change, I don’t think you have to test them all (very very unlikely to have any issue with replacing if (DisplayType.List == displayType) with if (DisplayType.isList(displayType)).
Actually, the isText fix has a higher chance of producing unexpected side effect than isList - that has potential to change existing flow as you can have isText comparison that comes before DisplayType.List == displayType check.

Hi @Carlos Ruiz / @Heng Sin Low,
I think both comments are exclusive, after checking, the 2pack problem, adding List to DisplayType.isText would be enough.
Changing
to
would produce the same outcome as the current patch, the Strings and List objects are handled by the same method in PoExporter. A similar validation is in the iDempiere-rest and so on.
However, being honest, changing the code in the other parts of the code that you mention is something big with many potential side-effects and I’m not sure how to test them all.
If you guys agree with my proposed solution, adding List to the isText method and changing it in the PoExporter as a first instance, I can proceed and modify the pull request.
Best regards,
Diego Ruiz
Another strange thing found:
DisplayType.isText includes all references that are saved as Text (including RadioGroupList and the ChosenMultiple, but it doesn't include List - that sounds like an missing reference there.
Hi @Diego Ruiz,
I searched for DisplayType.List in my eclipse and I found many occurrences of the same issue.
For example found 4 times the same problem in idempiere-rest, 2 times in omnisearch, 1 time in kanbanboard, 4 in fitnesse.
And a lot of occurrences in core (MColumn, MLookupFactory, MProcessPara, PO, DataEngine, RColumn, PackRollProcess, WWFActivity, InfoWindow, InfoGeneralPanel, DB_Oracle, DB_PostgreSQL, ModelADServiceImpl, Process)
I think maybe would be better to create a method DisplayType.isList - similar to the other is* methods, and replace the comparisons against DisplayType.List by calling to that method.
Regards,
Carlos Ruiz
When trying to export a window via 2pack with a newly created Field Group the Export Package process fails.
I reproduced the test case in https://demo.globalqss.com/webui/ (version 8.2) (Window Testing)
Steps to reproduce:
Login as System
Create a new Window in Window, Tab & Field
Run the copy Window Tabs process
Select any window
Navigate to a Field
Create a new Field Group record with any field group type or null
Set the newly created Field Group to a Field from the above-created window
Open the Pack out Window
Create a new record
Create a new package detail
Type = Window
Window = the new window
Run the Export Package process
Expected result
The window is exported
Actual result
The process fails with the following message: "Failed to export window tab"
The logs show this error:
After debugging the issue I found that the problem is that the FieldGroupType in AD_FieldGroup has the new type Radio button.