From 86e2b60b3c566486d8aee317eea80903a6f144ee Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Sat, 26 Mar 2011 01:07:13 -0500 Subject: [PATCH] BF [3160928] - Error reversing a shipment https://sourceforge.net/tracker/?func=detail&aid=3160928&group_id=176962&atid=879332 --- org.adempiere.base/src/org/compiere/model/MInOut.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/org.adempiere.base/src/org/compiere/model/MInOut.java b/org.adempiere.base/src/org/compiere/model/MInOut.java index b6a9995059..53a535316d 100644 --- a/org.adempiere.base/src/org/compiere/model/MInOut.java +++ b/org.adempiere.base/src/org/compiere/model/MInOut.java @@ -263,7 +263,7 @@ public class MInOut extends X_M_InOut implements DocAction if (counter) from.setRef_InOut_ID(to.getM_InOut_ID()); - if (to.copyLinesFrom(from, counter, setOrder) == 0) + if (to.copyLinesFrom(from, counter, setOrder) <= 0) throw new IllegalStateException("Could not create Shipment Lines"); return to; @@ -746,8 +746,10 @@ public class MInOut extends X_M_InOut implements DocAction fromLine.save(get_TrxName()); } } - if (fromLines.length != count) + if (fromLines.length != count) { log.log(Level.SEVERE, "Line difference - From=" + fromLines.length + " <> Saved=" + count); + count = -1; // caller must validate error in count and rollback accordingly - BF [3160928] + } return count; } // copyLinesFrom