diff --git a/base/src/org/compiere/model/MInOutLine.java b/base/src/org/compiere/model/MInOutLine.java index fdf0c1afa1..b3b719ce22 100644 --- a/base/src/org/compiere/model/MInOutLine.java +++ b/base/src/org/compiere/model/MInOutLine.java @@ -21,6 +21,7 @@ import java.sql.ResultSet; import java.util.List; import java.util.Properties; +import org.adempiere.exceptions.FillMandatoryException; import org.compiere.util.DB; import org.compiere.util.Env; import org.compiere.util.Msg; @@ -481,7 +482,12 @@ public class MInOutLine extends X_M_InOutLine */ protected boolean beforeSave (boolean newRecord) { - log.fine(""); + log.fine(""); + // Locator is mandatory if no charge is defined - teo_sarca BF [ 2757978 ] + if (getM_Locator_ID() <= 0 && getC_Charge_ID() <= 0) + { + throw new FillMandatoryException(COLUMNNAME_M_Locator_ID); + } // Get Line No if (getLine() == 0) { diff --git a/migration/353a-trunk/oracle/459_BF2757978.sql b/migration/353a-trunk/oracle/459_BF2757978.sql new file mode 100644 index 0000000000..5d616b35b9 --- /dev/null +++ b/migration/353a-trunk/oracle/459_BF2757978.sql @@ -0,0 +1,25 @@ +-- Apr 30, 2009 10:13:34 AM EEST +-- +UPDATE AD_Column SET IsMandatory='N',Updated=TO_DATE('2009-04-30 10:13:31','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Column_ID=3537 +; + +-- Apr 30, 2009 10:13:48 AM EEST +-- +ALTER TABLE M_InOutLine MODIFY M_Locator_ID NUMBER(10) DEFAULT NULL +; + +-- Apr 30, 2009 10:13:48 AM EEST +-- +ALTER TABLE M_InOutLine MODIFY M_Locator_ID NULL +; + +-- Apr 30, 2009 10:45:23 AM EEST +-- +UPDATE AD_Field SET IsMandatory='Y',Updated=TO_DATE('2009-04-30 10:45:21','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=3514 +; + +-- Apr 30, 2009 10:46:16 AM EEST +-- +UPDATE AD_Field SET IsMandatory='Y',Updated=TO_DATE('2009-04-30 10:46:16','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=2717 +; + diff --git a/migration/353a-trunk/postgresql/459_BF2757978.sql b/migration/353a-trunk/postgresql/459_BF2757978.sql new file mode 100644 index 0000000000..49f04c51bc --- /dev/null +++ b/migration/353a-trunk/postgresql/459_BF2757978.sql @@ -0,0 +1,25 @@ +-- Apr 30, 2009 10:13:34 AM EEST +-- +UPDATE AD_Column SET IsMandatory='N',Updated=TO_TIMESTAMP('2009-04-30 10:13:31','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Column_ID=3537 +; + +-- Apr 30, 2009 10:13:48 AM EEST +-- +insert into t_alter_column values('m_inoutline','M_Locator_ID','NUMERIC(10)',null,'NULL') +; + +-- Apr 30, 2009 10:13:48 AM EEST +-- +insert into t_alter_column values('m_inoutline','M_Locator_ID',null,'NULL',null) +; + +-- Apr 30, 2009 10:45:23 AM EEST +-- +UPDATE AD_Field SET IsMandatory='Y',Updated=TO_TIMESTAMP('2009-04-30 10:45:21','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=3514 +; + +-- Apr 30, 2009 10:46:16 AM EEST +-- +UPDATE AD_Field SET IsMandatory='Y',Updated=TO_TIMESTAMP('2009-04-30 10:46:16','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=2717 +; +