From 26f88e6fd2a13a9e205ffa7ff1b0e776f558dd0a Mon Sep 17 00:00:00 2001 From: Deepak Pansheriya Date: Fri, 9 Apr 2021 15:34:24 +0530 Subject: [PATCH] =?UTF-8?q?IDEMPIERE-4752=20:=20=20Cross=20tenant=20error?= =?UTF-8?q?=20fix=20while=20importing=20client=20data=20=E2=80=A6=20(#643)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * IDEMPIERE-4752 : Cross tenant error fix while importing client data 2pack * Update PackInHandler.java Co-authored-by: Carlos Ruiz --- .../src/org/adempiere/pipo2/PackInHandler.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/org.adempiere.pipo/src/org/adempiere/pipo2/PackInHandler.java b/org.adempiere.pipo/src/org/adempiere/pipo2/PackInHandler.java index 90fcd01feb..50744f78c0 100644 --- a/org.adempiere.pipo/src/org/adempiere/pipo2/PackInHandler.java +++ b/org.adempiere.pipo/src/org/adempiere/pipo2/PackInHandler.java @@ -521,9 +521,12 @@ public class PackInHandler extends DefaultHandler { if (!isUpdateRoleAccess) return; - List roles = new Query(m_ctx.ctx, MRole.Table_Name, "IsManual='N'", m_ctx.trx.getTrxName()) + int AD_Client_ID=Env.getAD_Client_ID(Env.getCtx()); + + List roles = new Query(m_ctx.ctx, MRole.Table_Name, "IsManual='N' AND (?=0 OR AD_Client_ID=?)", m_ctx.trx.getTrxName()) .setOnlyActiveRecords(true) .setOrderBy("AD_Client_ID, Name") + .setParameters(AD_Client_ID, AD_Client_ID) .list(); for (MRole role : roles) { role.updateAccessRecords(false);