From 3eb6bc9151a4b277ed0a3f88720b5756831b4ae5 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Wed, 23 Jan 2013 16:04:57 -0800 Subject: [PATCH] IDEMPIERE-592 Copy window is copying inactive tabs and fields --- .../src/org/compiere/process/WindowCopy.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/org.adempiere.base.process/src/org/compiere/process/WindowCopy.java b/org.adempiere.base.process/src/org/compiere/process/WindowCopy.java index 20af8b71b1..686ad1cc28 100644 --- a/org.adempiere.base.process/src/org/compiere/process/WindowCopy.java +++ b/org.adempiere.base.process/src/org/compiere/process/WindowCopy.java @@ -73,19 +73,19 @@ public class WindowCopy extends SvrProcess int tabCount = 0; int fieldCount = 0; - MTab[] oldTabs = from.getTabs(false, get_TrxName()); - for (int i = 0; i < oldTabs.length; i++) + for (MTab oldTab : from.getTabs(false, get_TrxName())) { - MTab oldTab = oldTabs[i]; + if (! oldTab.isActive()) + continue; MTab newTab = new MTab (to, oldTab); if (newTab.save()) { tabCount++; // Copy Fields - MField[] oldFields = oldTab.getFields(false, get_TrxName()); - for (int j = 0; j < oldFields.length; j++) + for (MField oldField : oldTab.getFields(false, get_TrxName())) { - MField oldField = oldFields[j]; + if (! oldField.isActive()) + continue; MField newField = new MField (newTab, oldField); if (newField.save()) fieldCount++;