Skip to content
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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

igorpojzl
Copy link
Contributor

general_schema=schema;
}

return general_schema;
Copy link
Collaborator

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.

Copy link
Contributor Author

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())
{
Copy link
Collaborator

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:

  1. 2 acctschema with orgonly_id for each org.
  2. 2 acctschema with a tenant schema for all and an org level schema with orgonly_id for second org.
  3. 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)
Copy link
Collaborator

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

Copy link
Collaborator

@hengsin hengsin left a 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.

@hengsin
Copy link
Collaborator

hengsin commented Dec 20, 2021

hi @igorpojzl , any update on this ?

@norbertbede
Copy link

@igorpojzl pls finish this PR this/next week. nb

@norbertbede
Copy link

delegated to @PeterTakacs300

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants