IDEMPIERE-1027 inactive fields are not or wrong copied in WindowCopy/TabCopy process

This commit is contained in:
Carlos Ruiz 2013-06-03 12:34:56 -05:00
parent e34e51ce3b
commit bd13bead02
2 changed files with 5 additions and 5 deletions

View File

@ -73,11 +73,11 @@ public class TabCopy extends SvrProcess
throw new AdempiereUserError("@Error@ @AD_Table_ID@"); throw new AdempiereUserError("@Error@ @AD_Table_ID@");
int count = 0; int count = 0;
MField[] oldFields = from.getFields(false, get_TrxName()); for (MField oldField : from.getFields(false, get_TrxName()))
for (int i = 0; i < oldFields.length; i++)
{ {
MField oldField = oldFields[i];
MField newField = new MField (to, oldField); MField newField = new MField (to, oldField);
if (! oldField.isActive())
newField.setIsActive(false);
if (newField.save()) if (newField.save())
count++; count++;
else else

View File

@ -84,9 +84,9 @@ public class WindowCopy extends SvrProcess
// Copy Fields // Copy Fields
for (MField oldField : oldTab.getFields(false, get_TrxName())) for (MField oldField : oldTab.getFields(false, get_TrxName()))
{ {
if (! oldField.isActive())
continue;
MField newField = new MField (newTab, oldField); MField newField = new MField (newTab, oldField);
if (! oldField.isActive())
newField.setIsActive(false);
if (newField.save()) if (newField.save())
fieldCount++; fieldCount++;
else else