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@");
int count = 0;
MField[] oldFields = from.getFields(false, get_TrxName());
for (int i = 0; i < oldFields.length; i++)
for (MField oldField : from.getFields(false, get_TrxName()))
{
MField oldField = oldFields[i];
MField newField = new MField (to, oldField);
if (! oldField.isActive())
newField.setIsActive(false);
if (newField.save())
count++;
else

View File

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