IDEMPIERE-4327 MPeriod.isOpen - should not perform update with cache PO (#105)

Do not perform update with MAcctSchema from cache
This commit is contained in:
hengsin 2020-06-09 18:19:47 +08:00 committed by GitHub
parent 3339d1395d
commit b50b533f43
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 3 deletions

View File

@ -643,11 +643,15 @@ public class MPeriod extends X_C_Period
return false;
}
// We are OK
if (isInPeriod(today))
if (isInPeriod(today) && as.getC_Period_ID() != getC_Period_ID())
{
as = new MAcctSchema(Env.getCtx(), as.getC_AcctSchema_ID(), null);
if (as.getC_Period_ID() != getC_Period_ID())
{
as.setC_Period_ID(getC_Period_ID());
as.saveEx();
}
}
return true;
}