IDEMPIERE-2073 AD_Val_Rule_ID is missing from AD_UserDef_Field

This commit is contained in:
Nicolas Micoud 2014-07-23 10:42:26 -05:00
parent d67c4db60a
commit ad302c7ded
5 changed files with 290 additions and 3 deletions

View File

@ -0,0 +1,122 @@
SET SQLBLANKLINES ON
SET DEFINE OFF
-- Jul 17, 2014 8:23:45 PM CEST
-- IDEMPIERE-2073
INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Column_UU,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FKConstraintType,FieldLength,Help,IsActive,IsAllowCopy,IsAllowLogging,IsAlwaysUpdateable,IsAutocomplete,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSecure,IsSelectionColumn,IsSyncDatabase,IsToolbarButton,IsTranslated,IsUpdateable,Name,SeqNo,SeqNoSelection,Updated,UpdatedBy,Version) VALUES (0,211571,'5bd0edd0-0f13-463e-bf7d-4f8f8d5a8aa3',139,0,19,464,'AD_Val_Rule_ID',TO_DATE('2014-07-17 20:23:44','YYYY-MM-DD HH24:MI:SS'),100,'Dynamic Validation Rule','D','N',22,'These rules define how an entry is determined to valid. You can use variables for dynamic (context sensitive) validation.','Y','Y','Y','N','N','N','N','N','N','N','N','N','N','N','N','Y','Dynamic Validation',0,0,TO_DATE('2014-07-17 20:23:44','YYYY-MM-DD HH24:MI:SS'),100,0)
;
-- Jul 17, 2014 8:23:48 PM CEST
UPDATE AD_Column SET FKConstraintName='ADValRule_ADUserDefField', FKConstraintType='N',Updated=TO_DATE('2014-07-17 20:23:48','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=211571
;
-- Jul 17, 2014 8:23:48 PM CEST
ALTER TABLE AD_UserDef_Field ADD AD_Val_Rule_ID NUMBER(10) DEFAULT NULL
;
-- Jul 17, 2014 8:23:48 PM CEST
ALTER TABLE AD_UserDef_Field ADD CONSTRAINT ADValRule_ADUserDefField FOREIGN KEY (AD_Val_Rule_ID) REFERENCES AD_VAL_RULE(AD_VAL_RULE_ID) DEFERRABLE INITIALLY DEFERRED
;
-- Jul 17, 2014 8:24:03 PM CEST
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Field_UU,AD_Org_ID,AD_Tab_ID,ColumnSpan,Created,CreatedBy,Description,DisplayLength,EntityType,Help,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,SeqNo,Updated,UpdatedBy) VALUES (0,211571,203266,'e0427cf3-b251-47c0-aa58-afc672aac597',0,395,2,TO_DATE('2014-07-17 20:24:03','YYYY-MM-DD HH24:MI:SS'),100,'Dynamic Validation Rule',22,'D','These rules define how an entry is determined to valid. You can use variables for dynamic (context sensitive) validation.','Y','Y','Y','N','N','N','N','N','Dynamic Validation',280,TO_DATE('2014-07-17 20:24:03','YYYY-MM-DD HH24:MI:SS'),100)
;
-- Jul 17, 2014 8:24:22 PM CEST
UPDATE AD_Field SET SeqNoGrid=160,IsDisplayedGrid='Y' WHERE AD_Field_ID=200857
;
-- Jul 17, 2014 8:24:22 PM CEST
UPDATE AD_Field SET SeqNoGrid=170,IsDisplayedGrid='Y' WHERE AD_Field_ID=200850
;
-- Jul 17, 2014 8:24:22 PM CEST
UPDATE AD_Field SET SeqNoGrid=180,IsDisplayedGrid='Y' WHERE AD_Field_ID=5055
;
-- Jul 17, 2014 8:24:22 PM CEST
UPDATE AD_Field SET SeqNoGrid=190,IsDisplayedGrid='Y' WHERE AD_Field_ID=11252
;
-- Jul 17, 2014 8:24:22 PM CEST
UPDATE AD_Field SET SeqNoGrid=200,IsDisplayedGrid='Y' WHERE AD_Field_ID=200853
;
-- Jul 17, 2014 8:24:22 PM CEST
UPDATE AD_Field SET SeqNoGrid=210,IsDisplayedGrid='Y' WHERE AD_Field_ID=200858
;
-- Jul 17, 2014 8:24:22 PM CEST
UPDATE AD_Field SET SeqNoGrid=220,IsDisplayedGrid='Y' WHERE AD_Field_ID=200856
;
-- Jul 17, 2014 8:24:22 PM CEST
UPDATE AD_Field SET SeqNoGrid=230,IsDisplayedGrid='Y' WHERE AD_Field_ID=200855
;
-- Jul 17, 2014 8:24:22 PM CEST
UPDATE AD_Field SET SeqNoGrid=240,IsDisplayedGrid='Y' WHERE AD_Field_ID=200849
;
-- Jul 17, 2014 8:24:22 PM CEST
UPDATE AD_Field SET SeqNoGrid=250,IsDisplayedGrid='Y' WHERE AD_Field_ID=200851
;
-- Jul 17, 2014 8:24:22 PM CEST
UPDATE AD_Field SET SeqNoGrid=260,IsDisplayedGrid='Y' WHERE AD_Field_ID=200852
;
-- Jul 17, 2014 8:24:22 PM CEST
UPDATE AD_Field SET SeqNoGrid=270,IsDisplayedGrid='Y' WHERE AD_Field_ID=200854
;
-- Jul 17, 2014 8:24:22 PM CEST
UPDATE AD_Field SET SeqNoGrid=280,IsDisplayedGrid='Y' WHERE AD_Field_ID=203266
;
-- Jul 17, 2014 8:24:59 PM CEST
UPDATE AD_Field SET SeqNo=210,IsDisplayed='Y' WHERE AD_Field_ID=203266
;
-- Jul 17, 2014 8:24:59 PM CEST
UPDATE AD_Field SET SeqNo=220,IsDisplayed='Y' WHERE AD_Field_ID=5054
;
-- Jul 17, 2014 8:24:59 PM CEST
UPDATE AD_Field SET SeqNo=230,IsDisplayed='Y' WHERE AD_Field_ID=200849
;
-- Jul 17, 2014 8:24:59 PM CEST
UPDATE AD_Field SET SeqNo=240,IsDisplayed='Y' WHERE AD_Field_ID=200851
;
-- Jul 17, 2014 8:24:59 PM CEST
UPDATE AD_Field SET SeqNo=250,IsDisplayed='Y' WHERE AD_Field_ID=200852
;
-- Jul 17, 2014 8:24:59 PM CEST
UPDATE AD_Field SET SeqNo=260,IsDisplayed='Y' WHERE AD_Field_ID=200854
;
-- Jul 17, 2014 8:24:59 PM CEST
UPDATE AD_Field SET SeqNo=270,IsDisplayed='Y' WHERE AD_Field_ID=5051
;
-- Jul 17, 2014 8:24:59 PM CEST
UPDATE AD_Field SET SeqNo=280,IsDisplayed='Y' WHERE AD_Field_ID=5057
;
-- Jul 17, 2014 8:25:24 PM CEST
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=210, XPosition=4,Updated=TO_DATE('2014-07-17 20:25:24','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=203266
;
-- Jul 17, 2014 8:26:05 PM CEST
UPDATE AD_Field SET DisplayLogic='@AD_Reference_ID@=17 | @AD_Reference_ID@=18 | @AD_Reference_ID@=19 | @AD_Reference_ID@=28 | @AD_Reference_ID@=30 | @AD_Reference_ID@=200012',Updated=TO_DATE('2014-07-17 20:26:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=203266
;
-- Jul 17, 2014 8:26:41 PM CEST
UPDATE AD_Field SET IsSameLine='Y',Updated=TO_DATE('2014-07-17 20:26:41','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=203266
;
SELECT register_migration_script('201407172028_IDEMPIERE-2073.sql') FROM dual
;

View File

@ -0,0 +1,119 @@
-- Jul 17, 2014 8:23:45 PM CEST
-- IDEMPIERE-2073
INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Column_UU,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FKConstraintType,FieldLength,Help,IsActive,IsAllowCopy,IsAllowLogging,IsAlwaysUpdateable,IsAutocomplete,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSecure,IsSelectionColumn,IsSyncDatabase,IsToolbarButton,IsTranslated,IsUpdateable,Name,SeqNo,SeqNoSelection,Updated,UpdatedBy,Version) VALUES (0,211571,'5bd0edd0-0f13-463e-bf7d-4f8f8d5a8aa3',139,0,19,464,'AD_Val_Rule_ID',TO_TIMESTAMP('2014-07-17 20:23:44','YYYY-MM-DD HH24:MI:SS'),100,'Dynamic Validation Rule','D','N',22,'These rules define how an entry is determined to valid. You can use variables for dynamic (context sensitive) validation.','Y','Y','Y','N','N','N','N','N','N','N','N','N','N','N','N','Y','Dynamic Validation',0,0,TO_TIMESTAMP('2014-07-17 20:23:44','YYYY-MM-DD HH24:MI:SS'),100,0)
;
-- Jul 17, 2014 8:23:48 PM CEST
UPDATE AD_Column SET FKConstraintName='ADValRule_ADUserDefField', FKConstraintType='N',Updated=TO_TIMESTAMP('2014-07-17 20:23:48','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=211571
;
-- Jul 17, 2014 8:23:48 PM CEST
ALTER TABLE AD_UserDef_Field ADD COLUMN AD_Val_Rule_ID NUMERIC(10) DEFAULT NULL
;
-- Jul 17, 2014 8:23:48 PM CEST
ALTER TABLE AD_UserDef_Field ADD CONSTRAINT ADValRule_ADUserDefField FOREIGN KEY (AD_Val_Rule_ID) REFERENCES AD_VAL_RULE(AD_VAL_RULE_ID) DEFERRABLE INITIALLY DEFERRED
;
-- Jul 17, 2014 8:24:03 PM CEST
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Field_UU,AD_Org_ID,AD_Tab_ID,ColumnSpan,Created,CreatedBy,Description,DisplayLength,EntityType,Help,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,SeqNo,Updated,UpdatedBy) VALUES (0,211571,203266,'e0427cf3-b251-47c0-aa58-afc672aac597',0,395,2,TO_TIMESTAMP('2014-07-17 20:24:03','YYYY-MM-DD HH24:MI:SS'),100,'Dynamic Validation Rule',22,'D','These rules define how an entry is determined to valid. You can use variables for dynamic (context sensitive) validation.','Y','Y','Y','N','N','N','N','N','Dynamic Validation',280,TO_TIMESTAMP('2014-07-17 20:24:03','YYYY-MM-DD HH24:MI:SS'),100)
;
-- Jul 17, 2014 8:24:22 PM CEST
UPDATE AD_Field SET SeqNoGrid=160,IsDisplayedGrid='Y' WHERE AD_Field_ID=200857
;
-- Jul 17, 2014 8:24:22 PM CEST
UPDATE AD_Field SET SeqNoGrid=170,IsDisplayedGrid='Y' WHERE AD_Field_ID=200850
;
-- Jul 17, 2014 8:24:22 PM CEST
UPDATE AD_Field SET SeqNoGrid=180,IsDisplayedGrid='Y' WHERE AD_Field_ID=5055
;
-- Jul 17, 2014 8:24:22 PM CEST
UPDATE AD_Field SET SeqNoGrid=190,IsDisplayedGrid='Y' WHERE AD_Field_ID=11252
;
-- Jul 17, 2014 8:24:22 PM CEST
UPDATE AD_Field SET SeqNoGrid=200,IsDisplayedGrid='Y' WHERE AD_Field_ID=200853
;
-- Jul 17, 2014 8:24:22 PM CEST
UPDATE AD_Field SET SeqNoGrid=210,IsDisplayedGrid='Y' WHERE AD_Field_ID=200858
;
-- Jul 17, 2014 8:24:22 PM CEST
UPDATE AD_Field SET SeqNoGrid=220,IsDisplayedGrid='Y' WHERE AD_Field_ID=200856
;
-- Jul 17, 2014 8:24:22 PM CEST
UPDATE AD_Field SET SeqNoGrid=230,IsDisplayedGrid='Y' WHERE AD_Field_ID=200855
;
-- Jul 17, 2014 8:24:22 PM CEST
UPDATE AD_Field SET SeqNoGrid=240,IsDisplayedGrid='Y' WHERE AD_Field_ID=200849
;
-- Jul 17, 2014 8:24:22 PM CEST
UPDATE AD_Field SET SeqNoGrid=250,IsDisplayedGrid='Y' WHERE AD_Field_ID=200851
;
-- Jul 17, 2014 8:24:22 PM CEST
UPDATE AD_Field SET SeqNoGrid=260,IsDisplayedGrid='Y' WHERE AD_Field_ID=200852
;
-- Jul 17, 2014 8:24:22 PM CEST
UPDATE AD_Field SET SeqNoGrid=270,IsDisplayedGrid='Y' WHERE AD_Field_ID=200854
;
-- Jul 17, 2014 8:24:22 PM CEST
UPDATE AD_Field SET SeqNoGrid=280,IsDisplayedGrid='Y' WHERE AD_Field_ID=203266
;
-- Jul 17, 2014 8:24:59 PM CEST
UPDATE AD_Field SET SeqNo=210,IsDisplayed='Y' WHERE AD_Field_ID=203266
;
-- Jul 17, 2014 8:24:59 PM CEST
UPDATE AD_Field SET SeqNo=220,IsDisplayed='Y' WHERE AD_Field_ID=5054
;
-- Jul 17, 2014 8:24:59 PM CEST
UPDATE AD_Field SET SeqNo=230,IsDisplayed='Y' WHERE AD_Field_ID=200849
;
-- Jul 17, 2014 8:24:59 PM CEST
UPDATE AD_Field SET SeqNo=240,IsDisplayed='Y' WHERE AD_Field_ID=200851
;
-- Jul 17, 2014 8:24:59 PM CEST
UPDATE AD_Field SET SeqNo=250,IsDisplayed='Y' WHERE AD_Field_ID=200852
;
-- Jul 17, 2014 8:24:59 PM CEST
UPDATE AD_Field SET SeqNo=260,IsDisplayed='Y' WHERE AD_Field_ID=200854
;
-- Jul 17, 2014 8:24:59 PM CEST
UPDATE AD_Field SET SeqNo=270,IsDisplayed='Y' WHERE AD_Field_ID=5051
;
-- Jul 17, 2014 8:24:59 PM CEST
UPDATE AD_Field SET SeqNo=280,IsDisplayed='Y' WHERE AD_Field_ID=5057
;
-- Jul 17, 2014 8:25:24 PM CEST
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=210, XPosition=4,Updated=TO_TIMESTAMP('2014-07-17 20:25:24','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=203266
;
-- Jul 17, 2014 8:26:05 PM CEST
UPDATE AD_Field SET DisplayLogic='@AD_Reference_ID@=17 | @AD_Reference_ID@=18 | @AD_Reference_ID@=19 | @AD_Reference_ID@=28 | @AD_Reference_ID@=30 | @AD_Reference_ID@=200012',Updated=TO_TIMESTAMP('2014-07-17 20:26:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=203266
;
-- Jul 17, 2014 8:26:41 PM CEST
UPDATE AD_Field SET IsSameLine='Y',Updated=TO_TIMESTAMP('2014-07-17 20:26:41','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=203266
;
SELECT register_migration_script('201407172028_IDEMPIERE-2073.sql') FROM dual
;

View File

@ -17,6 +17,8 @@
*****************************************************************************/ *****************************************************************************/
package org.compiere.model; package org.compiere.model;
import static org.compiere.model.SystemIDs.REFERENCE_AD_USER;
import java.io.Serializable; import java.io.Serializable;
import java.sql.ResultSet; import java.sql.ResultSet;
import java.sql.ResultSetMetaData; import java.sql.ResultSetMetaData;
@ -26,9 +28,9 @@ import java.util.Properties;
import java.util.logging.Level; import java.util.logging.Level;
import org.compiere.util.CLogger; import org.compiere.util.CLogger;
import org.compiere.util.DB;
import org.compiere.util.DisplayType; import org.compiere.util.DisplayType;
import org.compiere.util.Env; import org.compiere.util.Env;
import static org.compiere.model.SystemIDs.*;
/** /**
@ -297,7 +299,8 @@ public class GridFieldVO implements Serializable
//IDEMPIERE-1120 Implement Field SeqNo customization //IDEMPIERE-1120 Implement Field SeqNo customization
if (userDef.getSeqNo() > 0) if (userDef.getSeqNo() > 0)
vo.SeqNo = userDef.getSeqNo(); vo.SeqNo = userDef.getSeqNo();
if (userDef.getAD_Val_Rule_ID() > 0)
vo.ValidationCode = DB.getSQLValueStringEx(null, "SELECT Code FROM AD_Val_Rule WHERE AD_Val_Rule_ID = ?", userDef.getAD_Val_Rule_ID());
} }
} }
// //

View File

@ -136,6 +136,21 @@ public interface I_AD_UserDef_Field
public org.compiere.model.I_AD_UserDef_Tab getAD_UserDef_Tab() throws RuntimeException; public org.compiere.model.I_AD_UserDef_Tab getAD_UserDef_Tab() throws RuntimeException;
/** Column name AD_Val_Rule_ID */
public static final String COLUMNNAME_AD_Val_Rule_ID = "AD_Val_Rule_ID";
/** Set Dynamic Validation.
* Dynamic Validation Rule
*/
public void setAD_Val_Rule_ID (int AD_Val_Rule_ID);
/** Get Dynamic Validation.
* Dynamic Validation Rule
*/
public int getAD_Val_Rule_ID();
public org.compiere.model.I_AD_Val_Rule getAD_Val_Rule() throws RuntimeException;
/** Column name ColumnSpan */ /** Column name ColumnSpan */
public static final String COLUMNNAME_ColumnSpan = "ColumnSpan"; public static final String COLUMNNAME_ColumnSpan = "ColumnSpan";

View File

@ -30,7 +30,7 @@ public class X_AD_UserDef_Field extends PO implements I_AD_UserDef_Field, I_Pers
/** /**
* *
*/ */
private static final long serialVersionUID = 20131031L; private static final long serialVersionUID = 20140717L;
/** Standard Constructor */ /** Standard Constructor */
public X_AD_UserDef_Field (Properties ctx, int AD_UserDef_Field_ID, String trxName) public X_AD_UserDef_Field (Properties ctx, int AD_UserDef_Field_ID, String trxName)
@ -225,6 +225,34 @@ public class X_AD_UserDef_Field extends PO implements I_AD_UserDef_Field, I_Pers
return ii.intValue(); return ii.intValue();
} }
public org.compiere.model.I_AD_Val_Rule getAD_Val_Rule() throws RuntimeException
{
return (org.compiere.model.I_AD_Val_Rule)MTable.get(getCtx(), org.compiere.model.I_AD_Val_Rule.Table_Name)
.getPO(getAD_Val_Rule_ID(), get_TrxName()); }
/** Set Dynamic Validation.
@param AD_Val_Rule_ID
Dynamic Validation Rule
*/
public void setAD_Val_Rule_ID (int AD_Val_Rule_ID)
{
if (AD_Val_Rule_ID < 1)
set_Value (COLUMNNAME_AD_Val_Rule_ID, null);
else
set_Value (COLUMNNAME_AD_Val_Rule_ID, Integer.valueOf(AD_Val_Rule_ID));
}
/** Get Dynamic Validation.
@return Dynamic Validation Rule
*/
public int getAD_Val_Rule_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_AD_Val_Rule_ID);
if (ii == null)
return 0;
return ii.intValue();
}
/** Set Column Span. /** Set Column Span.
@param ColumnSpan @param ColumnSpan
Number of column for a box of field Number of column for a box of field