diff --git a/org.adempiere.base/src/org/compiere/model/MProduction.java b/org.adempiere.base/src/org/compiere/model/MProduction.java index 01f344d87f..46c361c813 100644 --- a/org.adempiere.base/src/org/compiere/model/MProduction.java +++ b/org.adempiere.base/src/org/compiere/model/MProduction.java @@ -545,6 +545,12 @@ public class MProduction extends X_M_Production implements DocAction { @Override public boolean voidIt() { + if (log.isLoggable(Level.INFO)) log.info(toString()); + // Before Void + m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_VOID); + if (m_processMsg != null) + return false; + if (DOCSTATUS_Closed.equals(getDocStatus()) || DOCSTATUS_Reversed.equals(getDocStatus()) || DOCSTATUS_Voided.equals(getDocStatus())) @@ -595,6 +601,11 @@ public class MProduction extends X_M_Production implements DocAction { return reverseCorrectIt(); } + // After Void + m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_VOID); + if (m_processMsg != null) + return false; + setProcessed(true); setDocAction(DOCACTION_None); return true; @@ -752,8 +763,8 @@ public class MProduction extends X_M_Production implements DocAction { @Override public boolean reverseAccrualIt() { if (log.isLoggable(Level.INFO)) log.info(toString()); - // Before reverseCorrect - m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REVERSECORRECT); + // Before reverseAccrual + m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REVERSEACCRUAL); if (m_processMsg != null) return false; @@ -761,8 +772,8 @@ public class MProduction extends X_M_Production implements DocAction { if (reversal == null) return false; - // After reverseCorrect - m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REVERSECORRECT); + // After reverseAccrual + m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REVERSEACCRUAL); if (m_processMsg != null) return false; @@ -773,7 +784,17 @@ public class MProduction extends X_M_Production implements DocAction { @Override public boolean reActivateIt() { - throw new UnsupportedOperationException(); + if (log.isLoggable(Level.INFO)) log.info("reActivateIt - " + toString()); + // Before reActivate + m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REACTIVATE); + if (m_processMsg != null) + return false; + + // After reActivate + m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REACTIVATE); + if (m_processMsg != null) + return false; + return false; } @Override