diff --git a/org.adempiere.base/src/org/adempiere/util/ModelClassGenerator.java b/org.adempiere.base/src/org/adempiere/util/ModelClassGenerator.java index 895fd5a055..a5e0a29e5b 100644 --- a/org.adempiere.base/src/org/adempiere/util/ModelClassGenerator.java +++ b/org.adempiere.base/src/org/adempiere/util/ModelClassGenerator.java @@ -35,6 +35,7 @@ import java.util.logging.Level; import org.adempiere.exceptions.DBException; import org.compiere.Adempiere; +import org.compiere.model.MPaymentLookup; import org.compiere.util.CLogger; import org.compiere.util.DB; import org.compiere.util.DisplayType; @@ -417,12 +418,21 @@ public class ModelClassGenerator sb.append("\tpublic void set").append(columnName).append(" (").append(dataType).append(" ").append(columnName).append(")").append(NL) .append("\t{").append(NL) ; + // List Validation if (AD_Reference_ID != 0 && String.class == clazz) { String staticVar = addListValidation (sb, AD_Reference_ID, columnName); sb.insert(0, staticVar); } + + // Payment Validation + if (displayType == DisplayType.Payment) + { + String staticVar = addListValidation (sb, MPaymentLookup.PAYMENTRULE_AD_Reference_ID, columnName); + sb.insert(0, staticVar); + } + // setValue ("ColumnName", xx); if (virtualColumn) { diff --git a/org.adempiere.base/src/org/compiere/model/MPaymentLookup.java b/org.adempiere.base/src/org/compiere/model/MPaymentLookup.java index 4e12509385..e696a4aaca 100644 --- a/org.adempiere.base/src/org/compiere/model/MPaymentLookup.java +++ b/org.adempiere.base/src/org/compiere/model/MPaymentLookup.java @@ -39,7 +39,7 @@ public class MPaymentLookup extends Lookup implements Serializable { */ private static final long serialVersionUID = -6863672221350217533L; - private static final int PAYMENT_RULE_REFERENCE_ID = 195; + public static final int PAYMENTRULE_AD_Reference_ID = 195; /** Context */ private Properties m_ctx; @@ -136,7 +136,7 @@ public class MPaymentLookup extends Lookup implements Serializable { try { pstmt = DB.prepareStatement(sb.toString(), null); - pstmt.setInt(1, PAYMENT_RULE_REFERENCE_ID); + pstmt.setInt(1, PAYMENTRULE_AD_Reference_ID); if (!isBaseLanguage) pstmt.setString(2, ad_language); rs = pstmt.executeQuery();