From 2c89382acae38ab7a70561f064d61459b0f74aa7 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Mon, 13 Dec 2021 02:52:58 +0100 Subject: [PATCH] IDEMPIERE-3340 Adaxa's User Favorite which allow user to organize their menu, create folders / fix Cross-tenant issue (#1046) --- .../org/adempiere/webui/desktop/FavouriteController.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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 f9780d6626..95efa3eb40 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 @@ -68,8 +68,13 @@ public class FavouriteController vTree.setAD_Org_ID(user.getAD_Org_ID()); // Support for System user vTree.set_ValueNoCheck(MTreeFavorite.COLUMNNAME_AD_User_ID, Integer.valueOf(AD_User_ID)); - if (!vTree.save()) - throw new AdempiereException(Msg.getMsg(Env.getCtx(), "FavTreeNotCreate")); + try { + PO.setCrossTenantSafe(); + if (!vTree.save()) + throw new AdempiereException(Msg.getMsg(Env.getCtx(), "FavTreeNotCreate")); + } finally { + PO.clearCrossTenantSafe(); + } m_AD_Tree_Favorite_ID = vTree.getAD_Tree_Favorite_ID(); }