Fixed: Converted GString to String while setting success message in receiveInventoryProduct service to avoid the ClassCastException. Also corrected loop condition while creating inventory information during PO receiving to fix the issue where each product is getting received two times (doubled the qty) instead of single time.(OFBIZ-11909)
@@ -108,7 +108,7 @@ def receiveInventoryProduct () {
}
}
- for (Double currentLoop = 0; currentLoop <= loops; currentLoop++) {
+ for (Double currentLoop = 0; currentLoop < loops; currentLoop++) {
logInfo("receiveInventoryProduct Looping and creating inventory info - ${currentLoop}")
// if there is an inventoryItemId, update it (this will happen when receiving serialized inventory already in the system, like for returns); if not create one
@@ -166,7 +166,7 @@ def receiveInventoryProduct () {
serviceInMap.inventoryItemId = currentInventoryItemId
run service:"balanceInventoryItems", with: serviceInMap
- successMessageList << "Received ${parameters.quantityAccepted} of ${parameters.productId} in inventory item ${currentInventoryItemId}"
+ successMessageList << "Received ${parameters.quantityAccepted} of ${parameters.productId} in inventory item ${currentInventoryItemId}".toString()
}
// return the last inventory item received
result.inventoryItemId = currentInventoryItemId
