IDEMPIERE-4256 [2pack] issue with export org (non office id) (#223)

Incorporate patch from hieplq - not to export ad_org_id for ad_org table
Fix typo for ad_org_id exclude check. Remove ad_org_id from exclude list
to maintain backward compatiblity.
This commit is contained in:
hengsin 2020-08-25 16:08:38 +08:00 committed by GitHub
parent a978949593
commit 60b173699f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 4 deletions

View File

@ -379,7 +379,6 @@ public abstract class AbstractElementHandler implements ElementHandler {
protected List<String> defaultExcludeList(String tableName) { protected List<String> defaultExcludeList(String tableName) {
List<String> excludes = new ArrayList<String>(); List<String> excludes = new ArrayList<String>();
excludes.add("ad_client_id"); excludes.add("ad_client_id");
excludes.add("ad_org_id");
excludes.add("created"); excludes.add("created");
excludes.add("createdby"); excludes.add("createdby");
excludes.add("updated"); excludes.add("updated");

View File

@ -6,6 +6,7 @@ import java.util.List;
import javax.xml.transform.sax.TransformerHandler; import javax.xml.transform.sax.TransformerHandler;
import org.adempiere.exceptions.AdempiereException; import org.adempiere.exceptions.AdempiereException;
import org.compiere.model.I_AD_Org;
import org.compiere.model.MTable; import org.compiere.model.MTable;
import org.compiere.model.MTree; import org.compiere.model.MTree;
import org.compiere.model.PO; import org.compiere.model.PO;
@ -183,12 +184,12 @@ public class PoExporter {
if (AD_Client_ID == 0) if (AD_Client_ID == 0)
{ {
addString("AD_Client_ID", "0", new AttributesImpl()); addString("AD_Client_ID", "0", new AttributesImpl());
if (excludes == null || !excludes.contains("AD_Org_ID")) if (excludes == null || !excludes.contains("ad_org_id"))
addString("AD_Org_ID", "0", new AttributesImpl()); addString("AD_Org_ID", "0", new AttributesImpl());
} }
else else
{ {
if (excludes == null || !excludes.contains("AD_Org_ID")) if (excludes == null || !excludes.contains("ad_org_id"))
{ {
int AD_Org_ID = po.getAD_Org_ID(); int AD_Org_ID = po.getAD_Org_ID();
if (AD_Org_ID == 0) if (AD_Org_ID == 0)
@ -201,7 +202,8 @@ public class PoExporter {
addString("AD_Org_ID", "@AD_Org_ID@", new AttributesImpl()); addString("AD_Org_ID", "@AD_Org_ID@", new AttributesImpl());
else { else {
addTableReference("AD_Client_ID", X_AD_Client.Table_Name, new AttributesImpl()); addTableReference("AD_Client_ID", X_AD_Client.Table_Name, new AttributesImpl());
addTableReference("AD_Org_ID", X_AD_Org.Table_Name, new AttributesImpl()); if (!(I_AD_Org.Table_Name.equals(po.get_TableName())))
addTableReference("AD_Org_ID", X_AD_Org.Table_Name, new AttributesImpl());
} }
} }
} }