From c8a09448b9ee3875f82344a750d5bfb697e3ab16 Mon Sep 17 00:00:00 2001 From: Heng Sin Low Date: Thu, 26 Dec 2013 13:55:58 +0800 Subject: [PATCH 1/4] IDEMPIERE-1644 Length 22 for AD_PrintFormatItem.FormatPattern is too short --- .../i2.0/oracle/201312260552_IDEMPIERE-1644.sql | 16 ++++++++++++++++ .../postgresql/201312260552_IDEMPIERE-1644.sql | 13 +++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 migration/i2.0/oracle/201312260552_IDEMPIERE-1644.sql create mode 100644 migration/i2.0/postgresql/201312260552_IDEMPIERE-1644.sql diff --git a/migration/i2.0/oracle/201312260552_IDEMPIERE-1644.sql b/migration/i2.0/oracle/201312260552_IDEMPIERE-1644.sql new file mode 100644 index 0000000000..696522af5b --- /dev/null +++ b/migration/i2.0/oracle/201312260552_IDEMPIERE-1644.sql @@ -0,0 +1,16 @@ +SET SQLBLANKLINES ON +SET DEFINE OFF + +-- Dec 26, 2013 12:22:23 PM MYT +-- IDEMPIERE-1644 Length 22 for AD_PrintFormatItem.FormatPattern is too short +UPDATE AD_Column SET FieldLength=60,Updated=TO_DATE('2013-12-26 12:22:23','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=56351 +; + +-- Dec 26, 2013 12:22:34 PM MYT +-- IDEMPIERE-1644 Length 22 for AD_PrintFormatItem.FormatPattern is too short +ALTER TABLE AD_PrintFormatItem MODIFY FormatPattern VARCHAR2(60) DEFAULT NULL +; + +SELECT register_migration_script('201312260552_IDEMPIERE-1644.sql') FROM dual +; + diff --git a/migration/i2.0/postgresql/201312260552_IDEMPIERE-1644.sql b/migration/i2.0/postgresql/201312260552_IDEMPIERE-1644.sql new file mode 100644 index 0000000000..c4fcbead22 --- /dev/null +++ b/migration/i2.0/postgresql/201312260552_IDEMPIERE-1644.sql @@ -0,0 +1,13 @@ +-- Dec 26, 2013 12:22:23 PM MYT +-- IDEMPIERE-1644 Length 22 for AD_PrintFormatItem.FormatPattern is too short +UPDATE AD_Column SET FieldLength=60,Updated=TO_TIMESTAMP('2013-12-26 12:22:23','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=56351 +; + +-- Dec 26, 2013 12:22:34 PM MYT +-- IDEMPIERE-1644 Length 22 for AD_PrintFormatItem.FormatPattern is too short +INSERT INTO t_alter_column values('ad_printformatitem','FormatPattern','VARCHAR(60)',null,'NULL') +; + +SELECT register_migration_script('201312260552_IDEMPIERE-1644.sql') FROM dual +; + From 9f7635ac7b1f7417d32a59016200c06f710f2056 Mon Sep 17 00:00:00 2001 From: hieplq Date: Thu, 26 Dec 2013 20:19:50 +0700 Subject: [PATCH 2/4] IDEMPIERE-1477 NPE on tree --- .../adempiere/webui/adwindow/ADTabpanel.java | 54 ++++++++----------- 1 file changed, 23 insertions(+), 31 deletions(-) diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/ADTabpanel.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/ADTabpanel.java index f41fbb00f8..9ecc039090 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/ADTabpanel.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/ADTabpanel.java @@ -614,17 +614,14 @@ DataStatusListener, IADTabpanel, IdSpace, IFieldEditorContainer if (gridTab.isTreeTab() && treePanel != null) { int AD_Tree_ID = Env.getContextAsInt (Env.getCtx(), getWindowNo(), "AD_Tree_ID", true); int AD_Tree_ID_Default = MTree.getDefaultAD_Tree_ID (Env.getAD_Client_ID(Env.getCtx()), gridTab.getKeyColumnName()); - if (gridTab.getRecord_ID() >= 0) { - if (AD_Tree_ID != 0) { - treePanel.initTree(AD_Tree_ID, windowNo); - Events.echoEvent(ON_DEFER_SET_SELECTED_NODE, this, null); - } else if (AD_Tree_ID_Default != 0) { - treePanel.initTree(AD_Tree_ID_Default, windowNo); - Events.echoEvent(ON_DEFER_SET_SELECTED_NODE, this, null); - } - } else { - treePanel.getTree().clear(); - } + + if (AD_Tree_ID != 0) { + treePanel.initTree(AD_Tree_ID, windowNo); + Events.echoEvent(ON_DEFER_SET_SELECTED_NODE, this, null); + } else if (AD_Tree_ID_Default != 0) { + treePanel.initTree(AD_Tree_ID_Default, windowNo); + Events.echoEvent(ON_DEFER_SET_SELECTED_NODE, this, null); + } } if (!gridTab.isSingleRow() && !isGridView()) @@ -1228,26 +1225,21 @@ DataStatusListener, IADTabpanel, IdSpace, IFieldEditorContainer if (refresh) { int AD_Tree_ID = Env.getContextAsInt (Env.getCtx(), getWindowNo(), "AD_Tree_ID", true); - if (gridTab.getRecord_ID()>=0) - { - if (AD_Tree_ID != 0) - { - if (treePanel.initTree(AD_Tree_ID, windowNo)) - echoDeferSetSelectedNodeEvent(); - else - setSelectedNode(gridTab.getRecord_ID()); - - } - else - { - AD_Tree_ID = MTree.getDefaultAD_Tree_ID (Env.getAD_Client_ID(Env.getCtx()), gridTab.getKeyColumnName()); - treePanel.initTree(AD_Tree_ID, windowNo); - } - } - else - { - treePanel.getTree().clear(); - } + + if (AD_Tree_ID != 0) + { + if (treePanel.initTree(AD_Tree_ID, windowNo)) + echoDeferSetSelectedNodeEvent(); + else + setSelectedNode(gridTab.getRecord_ID()); + + } + else + { + AD_Tree_ID = MTree.getDefaultAD_Tree_ID (Env.getAD_Client_ID(Env.getCtx()), gridTab.getKeyColumnName()); + treePanel.initTree(AD_Tree_ID, windowNo); + } + } }else if(e.isInserting() && gridTab.getRecord_ID() < 0 && gridTab.getTabLevel() > 0 ) From 38ef57f99de484b37052d2186480f2397f21e863 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Thu, 26 Dec 2013 17:31:30 -0500 Subject: [PATCH 3/4] IDEMPIERE-1642 Window Customization with no window name give null on Recent Items / thanks to Nicolas Micoud (nmicoud) --- org.adempiere.base/src/org/compiere/model/MRecentItem.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/org.adempiere.base/src/org/compiere/model/MRecentItem.java b/org.adempiere.base/src/org/compiere/model/MRecentItem.java index 394d3ec490..deaa67c253 100644 --- a/org.adempiere.base/src/org/compiere/model/MRecentItem.java +++ b/org.adempiere.base/src/org/compiere/model/MRecentItem.java @@ -29,6 +29,7 @@ import org.compiere.util.CCache; import org.compiere.util.CLogger; import org.compiere.util.DB; import org.compiere.util.Env; +import org.compiere.util.Util; import org.idempiere.distributed.IMessageService; import org.idempiere.distributed.ITopic; import org.osgi.service.event.Event; @@ -278,7 +279,7 @@ public class MRecentItem extends X_AD_RecentItem public String getLabel() { String windowName; MUserDefWin userDef = MUserDefWin.getBestMatch(getCtx(), getAD_Window_ID()); - if (userDef != null) { + if (userDef != null && !Util.isEmpty(userDef.getName())) { windowName = userDef.getName(); } else { MWindow win = new MWindow(getCtx(), getAD_Window_ID(), null); From 9e17fdff494d0221088568b768cb89beba9f4d89 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Thu, 26 Dec 2013 18:27:37 -0500 Subject: [PATCH 4/4] IDEMPIERE-1357 Tree panel not is updated with result of Find window / testing IDEMPIERE-1477 found that IDEMPIERE-1357 was back --- .../src/org/adempiere/webui/adwindow/ADTabpanel.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/ADTabpanel.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/ADTabpanel.java index 9ecc039090..0120c021f3 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/ADTabpanel.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/ADTabpanel.java @@ -26,6 +26,7 @@ import java.util.Map.Entry; import java.util.logging.Level; import org.adempiere.base.Core; +import org.adempiere.exceptions.AdempiereException; import org.adempiere.webui.AdempiereIdGenerator; import org.adempiere.webui.AdempiereWebUI; import org.adempiere.webui.LayoutUtils; @@ -1141,7 +1142,11 @@ DataStatusListener, IADTabpanel, IdSpace, IFieldEditorContainer { if (nodeID > 0 && logger.isLoggable(Level.WARNING)) logger.log(Level.WARNING, "Tab does not have ID with Node_ID=" + nodeID); - return; + if (gridTab.getCurrentRow() >= 0) + { + gridTab.setCurrentRow(gridTab.getCurrentRow(), true); + } + throw new AdempiereException(Msg.getMsg(Env.getCtx(),"RecordIsNotInCurrentSearch")); } // Navigate to node row