diff --git a/migration/i6.2/oracle/201903181955_IDEMPIERE-3528.sql b/migration/i6.2/oracle/201903181955_IDEMPIERE-3528.sql new file mode 100644 index 0000000000..87daf6396f --- /dev/null +++ b/migration/i6.2/oracle/201903181955_IDEMPIERE-3528.sql @@ -0,0 +1,8 @@ +UPDATE ad_treebar SET ad_client_id=(SELECT ad_client_id FROM ad_user WHERE ad_user.ad_user_id=ad_treebar.ad_user_id) +WHERE ad_client_id!=(SELECT ad_client_id FROM ad_user WHERE ad_user.ad_user_id=ad_treebar.ad_user_id); + +UPDATE ad_treebar SET ad_org_id=0 WHERE ad_org_id!=0; + +SELECT register_migration_script('201903181955_IDEMPIERE-3528.sql') FROM dual +; + diff --git a/migration/i6.2/postgresql/201903181955_IDEMPIERE-3528.sql b/migration/i6.2/postgresql/201903181955_IDEMPIERE-3528.sql new file mode 100644 index 0000000000..87daf6396f --- /dev/null +++ b/migration/i6.2/postgresql/201903181955_IDEMPIERE-3528.sql @@ -0,0 +1,8 @@ +UPDATE ad_treebar SET ad_client_id=(SELECT ad_client_id FROM ad_user WHERE ad_user.ad_user_id=ad_treebar.ad_user_id) +WHERE ad_client_id!=(SELECT ad_client_id FROM ad_user WHERE ad_user.ad_user_id=ad_treebar.ad_user_id); + +UPDATE ad_treebar SET ad_org_id=0 WHERE ad_org_id!=0; + +SELECT register_migration_script('201903181955_IDEMPIERE-3528.sql') FROM dual +; + diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/desktop/FavouriteController.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/desktop/FavouriteController.java index 5d48cb8b25..737943e024 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/desktop/FavouriteController.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/desktop/FavouriteController.java @@ -3,6 +3,8 @@ */ package org.adempiere.webui.desktop; +import static org.compiere.model.SystemIDs.TREE_MENUPRIMARY; + import java.util.ArrayList; import java.util.Enumeration; import java.util.LinkedHashMap; @@ -12,12 +14,11 @@ import java.util.Map; import org.adempiere.util.Callback; import org.compiere.model.MTree; import org.compiere.model.MTreeNode; +import org.compiere.model.MUser; import org.compiere.util.DB; import org.compiere.util.Env; import org.zkoss.zk.ui.Session; -import static org.compiere.model.SystemIDs.TREE_MENUPRIMARY; - /** * @author hengsin * @@ -83,8 +84,8 @@ public class FavouriteController { private boolean barDBupdate(boolean add, int Node_ID) { - int AD_Client_ID = Env.getAD_Client_ID(Env.getCtx()); - int AD_Org_ID = Env.getContextAsInt(Env.getCtx(), "#AD_Org_ID"); + int AD_Client_ID = MUser.get(Env.getCtx()).getAD_Client_ID(); + int AD_Org_ID = 0; int AD_User_ID = Env.getContextAsInt(Env.getCtx(), "#AD_User_ID"); StringBuilder sql = new StringBuilder(); if (add)