I had a moment to look at this and found a brute force way to get at the characteristics on this screen, but with some caveats. While you can get access to the widgets that are added dynamically the objectName property on these widgets is not set, meaning you can only identify them by their class, so if you got a DLineEdit for a date or an XLineEdit for the text boxes and XComboBox for combo boxes. If you only had one of each you could get away with it as is, but if you have more than one of each you wouldn’t be able to tell which combo box was for which characteristic, for instance.
Here is the code, create a script called createLotSerial:
var _grid = mywindow.findChild("gridLayout");
var widgets = {};
var widgetCount = 0;
for (var i = 0; i < _grid.rowCount(); i += 1) {
for (var c = 0; c < _grid.columnCount(); c += 1) {
var li = _grid.itemAtPosition(i,c);
if (li && li.widget()) {
widgets[widgetCount] = li.widget();
widgetCount += 1;
}
}
}
debugger; // now widgets has all the widgets from the grid
However as I mentioned before there is no direct way to know what characteristic the widget represents. You may be able to get away with assuming if there are a common set of characteristics but that could get messy quick if you have different characteristics for different items.
All is not lost, please file a feature request to make LotSerialUtils set the objectName property on the widgets when it adds them to the grid here: https://github.com/xtuple/qt-client/blob/4_11_x/guiclient/lotSerialUtils.cpp#L156-L209. If we set the objectName to be the name of the characteristic it would be simple to retrieve from the window with mywindow.findChild() instead of having to do the witch hunt like above.