IDEMPIERE-5212 Cross tenant PO writing in MFAUnregister #resolve #fixversion 10 #comment Solve Cross tenant PO (#1209)

This commit is contained in:
Carlos Ruiz 2022-03-01 19:18:47 +01:00 committed by GitHub
parent b1d1ac2bba
commit 72ee50fcf5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 1 deletions

View File

@ -31,6 +31,7 @@ import java.sql.Timestamp;
import java.util.logging.Level;
import org.compiere.model.MMFARegistration;
import org.compiere.model.PO;
/**
* IDEMPIERE-4782
@ -68,7 +69,12 @@ public class MFAUnregister extends SvrProcess {
MMFARegistration reg = new MMFARegistration(getCtx(), p_MFA_Registration_ID, get_TrxName());
reg.setIsActive(false);
reg.setMFAUnregisteredAt(new Timestamp(System.currentTimeMillis()));
reg.saveEx();
try {
PO.setCrossTenantSafe();
reg.saveEx();
} finally {
PO.clearCrossTenantSafe();
}
return "@OK@";
}