diff --git a/org.adempiere.base/src/org/compiere/model/MInOut.java b/org.adempiere.base/src/org/compiere/model/MInOut.java index e9eb47a446..c68d731039 100644 --- a/org.adempiere.base/src/org/compiere/model/MInOut.java +++ b/org.adempiere.base/src/org/compiere/model/MInOut.java @@ -1628,9 +1628,9 @@ public class MInOut extends X_M_InOut implements DocAction } if (!po.isPosted()) addDocsPostProcess(po); - if (po.getMatchInvCreated() != null) { - addDocsPostProcess(po.getMatchInvCreated()); - po.setMatchInvCreated(null); + MMatchInv matchInvCreated = po.getMatchInvCreated(); + if (matchInvCreated != null) { + addDocsPostProcess(matchInvCreated); } } // Update PO with ASI diff --git a/org.adempiere.base/src/org/compiere/model/MMatchPO.java b/org.adempiere.base/src/org/compiere/model/MMatchPO.java index 99bf94df30..8bc2e6e388 100644 --- a/org.adempiere.base/src/org/compiere/model/MMatchPO.java +++ b/org.adempiere.base/src/org/compiere/model/MMatchPO.java @@ -551,15 +551,24 @@ public class MMatchPO extends X_M_MatchPO private MMatchInv m_matchInv; + /** * Register the match inv created for immediate accounting purposes * @param matchInv */ - public void setMatchInvCreated(MMatchInv matchInv) { + private void setMatchInvCreated(MMatchInv matchInv) { m_matchInv = matchInv; } + + /** + * Get the match inv created for immediate accounting purposes + * Is cleared after read, so if you read twice second time it returns null + * @param matchInv + */ public MMatchInv getMatchInvCreated() { - return m_matchInv; + MMatchInv tmp = m_matchInv; + m_matchInv = null; + return tmp; } /** Static Logger */