IDEMPIERE-4752 : Cross tenant error fix while importing client data … (#643)

* IDEMPIERE-4752 :  Cross tenant error fix while importing client data 2pack

* Update PackInHandler.java

Co-authored-by: Carlos Ruiz <carg67@gmail.com>
This commit is contained in:
Deepak Pansheriya 2021-04-09 15:34:24 +05:30 committed by GitHub
parent 9742c0dbc9
commit 26f88e6fd2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -521,9 +521,12 @@ public class PackInHandler extends DefaultHandler {
if (!isUpdateRoleAccess) if (!isUpdateRoleAccess)
return; return;
List<MRole> 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<MRole> roles = new Query(m_ctx.ctx, MRole.Table_Name, "IsManual='N' AND (?=0 OR AD_Client_ID=?)", m_ctx.trx.getTrxName())
.setOnlyActiveRecords(true) .setOnlyActiveRecords(true)
.setOrderBy("AD_Client_ID, Name") .setOrderBy("AD_Client_ID, Name")
.setParameters(AD_Client_ID, AD_Client_ID)
.list(); .list();
for (MRole role : roles) { for (MRole role : roles) {
role.updateAccessRecords(false); role.updateAccessRecords(false);