IDEMPIERE-1326 2pack is not adding treenodemm to menus on top
This commit is contained in:
parent
b37f5e3a9d
commit
a576485e2c
|
@ -104,7 +104,6 @@ public class MenuElementHandler extends AbstractElementHandler {
|
||||||
parentId = ReferenceUtils.resolveReference(ctx.ctx, parentElement, getTrxName(ctx));
|
parentId = ReferenceUtils.resolveReference(ctx.ctx, parentElement, getTrxName(ctx));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (parentId > 0) {
|
|
||||||
StringBuffer updateSQL = null;
|
StringBuffer updateSQL = null;
|
||||||
int AD_Tree_ID = getDefaultMenuTreeId();
|
int AD_Tree_ID = getDefaultMenuTreeId();
|
||||||
String sql = "SELECT count(Parent_ID) FROM AD_TREENODEMM WHERE AD_Tree_ID = "+AD_Tree_ID
|
String sql = "SELECT count(Parent_ID) FROM AD_TREENODEMM WHERE AD_Tree_ID = "+AD_Tree_ID
|
||||||
|
@ -169,7 +168,7 @@ public class MenuElementHandler extends AbstractElementHandler {
|
||||||
" WHERE AD_Tree_ID = "+AD_Tree_ID).append(
|
" WHERE AD_Tree_ID = "+AD_Tree_ID).append(
|
||||||
" AND Node_ID = " + mMenu.getAD_Menu_ID());
|
" AND Node_ID = " + mMenu.getAD_Menu_ID());
|
||||||
} else {
|
} else {
|
||||||
updateSQL = new StringBuffer("Insert INTO AD_TREENODEMM").append(
|
updateSQL = new StringBuffer("INSERT INTO AD_TREENODEMM").append(
|
||||||
"(AD_Client_ID, AD_Org_ID, CreatedBy, UpdatedBy, ").append(
|
"(AD_Client_ID, AD_Org_ID, CreatedBy, UpdatedBy, ").append(
|
||||||
"Parent_ID, SeqNo, AD_Tree_ID, Node_ID)").append(
|
"Parent_ID, SeqNo, AD_Tree_ID, Node_ID)").append(
|
||||||
"VALUES(0, 0, 0, 0, ").append(
|
"VALUES(0, 0, 0, 0, ").append(
|
||||||
|
@ -178,7 +177,6 @@ public class MenuElementHandler extends AbstractElementHandler {
|
||||||
}
|
}
|
||||||
DB.executeUpdate(updateSQL.toString(), getTrxName(ctx));
|
DB.executeUpdate(updateSQL.toString(), getTrxName(ctx));
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
private int getDefaultMenuTreeId() {
|
private int getDefaultMenuTreeId() {
|
||||||
return DB.getSQLValue(null, "SELECT AD_Tree_ID FROM AD_Tree WHERE TreeType='MM' AND AD_Client_ID=0 ORDER BY IsDefault DESC, AD_Tree_ID");
|
return DB.getSQLValue(null, "SELECT AD_Tree_ID FROM AD_Tree WHERE TreeType='MM' AND AD_Client_ID=0 ORDER BY IsDefault DESC, AD_Tree_ID");
|
||||||
|
|
Loading…
Reference in New Issue