New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IDEMPIERE-4892 Auto Period doesn't check only org schema #803
base: master
Are you sure you want to change the base?
Conversation
general_schema=schema; | ||
} | ||
|
||
return general_schema; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This have been talked before and the current definition of acctschema by org is an ambiguous one since the system doesn't stop you from having > 1 acctschema with same ad_orgonly_id.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed to return Array of schemas. In MPeriod we check if any Org Schema has autoperiod Control, we will use first with autoperiodcontrol set.
Other solution could be to add Schema_ID as parameter to isOpen method.
|
||
if(as == null) | ||
as = MClient.get(getCtx(), getAD_Client_ID()).getAcctSchema(); | ||
|
||
if (as != null && as.isAutoPeriodControl()) | ||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hi @igorpojzl ,
The current model is actually very open ended. For e.g, with 2 org, you can have:
- 2 acctschema with orgonly_id for each org.
- 2 acctschema with a tenant schema for all and an org level schema with orgonly_id for second org.
- 3 acctschema with 1 schema for org1 and 2 schema for org2.
I guess to be complete, you should check client level schema and all org level schema with orgonly_id = ad_org_id.
@@ -179,6 +179,20 @@ public static MAcctSchema getCopy(Properties ctx, int C_AcctSchema_ID, String tr | |||
s_schema.put(key, Arrays.stream(retValue).map(e -> {return new MAcctSchema(Env.getCtx(), e).markImmutable();}).toArray(MAcctSchema[]::new)); | |||
return retValue; | |||
} // getClientAcctSchema | |||
|
|||
public static MAcctSchema[] getSchemasByOrg(Properties ctx, int AD_Client_ID, int AD_Org_ID, String trxName) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should have basic javadoc here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is incomplete, you should check client level schema and all org level schema with orgonly_id = ad_org_id.
hi @igorpojzl , any update on this ? |
@igorpojzl pls finish this PR this/next week. nb |
delegated to @PeterTakacs300 |
Jira: https://idempiere.atlassian.net/browse/IDEMPIERE-4892