diff --git a/base/src/org/compiere/model/MElementValue.java b/base/src/org/compiere/model/MElementValue.java index 9be8a91a9c..1210ceed70 100644 --- a/base/src/org/compiere/model/MElementValue.java +++ b/base/src/org/compiere/model/MElementValue.java @@ -224,8 +224,15 @@ public class MElementValue extends X_C_ElementValue protected boolean afterSave (boolean newRecord, boolean success) { if (newRecord) - insert_Tree(MTree_Base.TREETYPE_ElementValue, getC_Element_ID()); - + { + // afalcone [Bugs #1837219] + int ad_Tree_ID= (new MElement(getCtx(), getC_Element_ID(), null)).getAD_Tree_ID(); + String treeType= (new MTree(getCtx(),ad_Tree_ID,null)).getTreeType(); + insert_Tree(treeType, getC_Element_ID()); + // insert_Tree(MTree_Base.TREETYPE_ElementValue, getC_Element_ID()); Old + + } + // Value/Name change if (!newRecord && (is_ValueChanged("Value") || is_ValueChanged("Name"))) { diff --git a/base/src/org/compiere/model/MTree_Base.java b/base/src/org/compiere/model/MTree_Base.java index b5759e8e36..ed417f7ab9 100644 --- a/base/src/org/compiere/model/MTree_Base.java +++ b/base/src/org/compiere/model/MTree_Base.java @@ -177,8 +177,16 @@ public class MTree_Base extends X_AD_Tree else if (treeType.equals(TREETYPE_CMTemplate)) sourceTable = "CM_Template"; // User Trees -// else if (treeType.equals(TREETYPE_User1)) -// sourceTable = "??"; + // afalcone [Bugs #1837219] + else if (treeType.equals(TREETYPE_User1) || + treeType.equals(TREETYPE_User2) || + treeType.equals(TREETYPE_User3) || + treeType.equals(TREETYPE_User4)) + sourceTable = "C_ElementValue"; + + // else if (treeType.equals(TREETYPE_User1)) + // sourceTable = "??"; + // end afalcone return sourceTable; } // getSourceTableName