IDEMPIERE-5133 Organization Window & Tab newly created records does not show on idempiere but its created in the database (#1103)

This commit is contained in:
Carlos Ruiz 2022-01-03 12:37:42 +01:00 committed by GitHub
parent 7c116c2dd8
commit 950e674a30
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 20 additions and 1 deletions

View File

@ -20,8 +20,11 @@ import java.sql.ResultSet;
import java.util.List; import java.util.List;
import java.util.Properties; import java.util.Properties;
import org.compiere.util.CacheMgt;
import org.compiere.util.DB; import org.compiere.util.DB;
import org.compiere.util.Env; import org.compiere.util.Env;
import org.compiere.util.Trx;
import org.compiere.util.TrxEventListener;
import org.idempiere.cache.ImmutableIntPOCache; import org.idempiere.cache.ImmutableIntPOCache;
import org.idempiere.cache.ImmutablePOSupport; import org.idempiere.cache.ImmutablePOSupport;
@ -211,6 +214,22 @@ public class MOrg extends X_AD_Org implements ImmutablePOSupport
MAccount.updateValueDescription(getCtx(), "AD_OrgTrx_ID=" + getAD_Org_ID(), get_TrxName()); MAccount.updateValueDescription(getCtx(), "AD_OrgTrx_ID=" + getAD_Org_ID(), get_TrxName());
} }
Trx.get(get_TrxName(), false).addTrxEventListener(new TrxEventListener() {
@Override
public void afterRollback(Trx trx, boolean success) {
}
@Override
public void afterCommit(Trx trx, boolean success) {
MRole.getDefault().loadAccess(true);
CacheMgt.get().reset();
}
@Override
public void afterClose(Trx trx) {
}
});
return true; return true;
} // afterSave } // afterSave