IDEMPIERE-5369 - Dashboard Cross Tenant Check (#1425)

This commit is contained in:
Peter Takács 2022-08-19 12:01:22 +02:00 committed by GitHub
parent ce22d1cc51
commit ab78a8acbd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 2 deletions

View File

@ -62,6 +62,7 @@ import org.compiere.model.MPInstancePara;
import org.compiere.model.MProcess;
import org.compiere.model.MProcessPara;
import org.compiere.model.MSysConfig;
import org.compiere.model.PO;
import org.compiere.print.ReportEngine;
import org.compiere.process.ProcessInfo;
import org.compiere.tools.FileUtil;
@ -661,8 +662,13 @@ public class DashboardController implements EventListener<Event> {
int PA_DashboardPreference_ID = Integer.parseInt(value.toString());
MDashboardPreference preference = new MDashboardPreference(Env.getCtx(), PA_DashboardPreference_ID, null);
preference.setIsCollapsedByDefault(!panel.isOpen());
if (!preference.save())
logger.log(Level.SEVERE, "Failed to save dashboard preference " + preference.toString());
try {
PO.setCrossTenantSafe();
if (!preference.save())
logger.log(Level.SEVERE, "Failed to save dashboard preference " + preference.toString());
} finally {
PO.clearCrossTenantSafe();
}
}
}
}