From 9b812a315f813053128700e09540ef4c2fb71879 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Fri, 5 Aug 2022 00:11:06 +0200 Subject: [PATCH] IDEMPIERE-3340 Fix cross tenant in Favourites (#1426) --- org.adempiere.base/src/org/compiere/model/MTreeFavorite.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/org.adempiere.base/src/org/compiere/model/MTreeFavorite.java b/org.adempiere.base/src/org/compiere/model/MTreeFavorite.java index 555586d626..7b4996afb5 100644 --- a/org.adempiere.base/src/org/compiere/model/MTreeFavorite.java +++ b/org.adempiere.base/src/org/compiere/model/MTreeFavorite.java @@ -38,7 +38,7 @@ public class MTreeFavorite extends X_AD_Tree_Favorite public static final String SQL_GET_TREE_FAVORITE_ID = "SELECT AD_Tree_Favorite_ID FROM AD_Tree_Favorite WHERE IsActive='Y' AND AD_User_ID=?"; public static final String SQL_GET_TREE_FAVORITE_NODE = "SELECT AD_Tree_Favorite_Node_ID, Parent_ID, SeqNo, Name, IsSummary, AD_Menu_ID, IsCollapsible, IsFavourite " - + " FROM AD_Tree_Favorite_Node WHERE IsActive='Y' AND AD_Tree_Favorite_ID=? " + + " FROM AD_Tree_Favorite_Node WHERE IsActive='Y' AND AD_Tree_Favorite_ID=? AND AD_Client_ID IN (0,?) " + " ORDER BY COALESCE(Parent_ID, -1), SeqNo, Name "; /** Cache for AD_Tree_Favorite_ID */ @@ -91,6 +91,7 @@ public class MTreeFavorite extends X_AD_Tree_Favorite pstmt = DB.prepareStatement(SQL_GET_TREE_FAVORITE_NODE, get_TrxName()); pstmt.setInt(1, getAD_Tree_Favorite_ID()); + pstmt.setInt(2, Env.getAD_Client_ID(Env.getCtx())); rs = pstmt.executeQuery(); while (rs.next()) {