IDEMPIERE-4268 Fix issue with change client (#418)

Fix problem changing client in role panel when more than 2 clients
This commit is contained in:
Carlos Ruiz 2020-11-27 20:24:21 +01:00 committed by GitHub
parent 386610f379
commit 71a2ee3fe7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 12 deletions

View File

@ -433,18 +433,6 @@ public class RolePanel extends Window implements EventListener<Event>, Deferrabl
}
//
//force reload of default role
int cid = Env.getAD_Client_ID(m_ctx);
try
{
Env.setContext(m_ctx, Env.AD_CLIENT_ID, clientId);
MRole.getDefault(m_ctx, true);
}
finally
{
Env.setContext(m_ctx, Env.AD_CLIENT_ID, cid);
}
// If we have only one role, we can make readonly the combobox
if (lstRole.getItemCount() == 1)
{
@ -697,6 +685,10 @@ public class RolePanel extends Window implements EventListener<Event>, Deferrabl
userPreference.setProperty(UserPreference.P_ORG, (String) lstItemOrg.getValue());
userPreference.setProperty(UserPreference.P_WAREHOUSE, lstItemWarehouse != null ? (String) lstItemWarehouse.getValue() : "0");
userPreference.savePreference();
//force reload of default role
MRole.getDefault(m_ctx, true);
//
}