diff --git a/org.adempiere.base/src/org/compiere/model/Lookup.java b/org.adempiere.base/src/org/compiere/model/Lookup.java index cfe6264717..f2171c64e7 100644 --- a/org.adempiere.base/src/org/compiere/model/Lookup.java +++ b/org.adempiere.base/src/org/compiere/model/Lookup.java @@ -43,7 +43,7 @@ public abstract class Lookup extends AbstractListModel /** * */ - private static final long serialVersionUID = -28200392264647953L; + private static final long serialVersionUID = -2500275921218601088L; /** * Lookup @@ -468,8 +468,14 @@ public abstract class Lookup extends AbstractListModel * @param key key * @param saveInCache save in cache for r/w * @param cacheLocal cache locally for r/o + * @param trxName the transaction name * @return value */ + public NamePair getDirect (Object key, boolean saveInCache, boolean cacheLocal, String trxName) + { + return get (key); + } // getDirect + public NamePair getDirect (Object key, boolean saveInCache, boolean cacheLocal) { return get (key); diff --git a/org.adempiere.base/src/org/compiere/model/MLookup.java b/org.adempiere.base/src/org/compiere/model/MLookup.java index fbf48b26cc..e8ba95e710 100644 --- a/org.adempiere.base/src/org/compiere/model/MLookup.java +++ b/org.adempiere.base/src/org/compiere/model/MLookup.java @@ -56,7 +56,7 @@ public final class MLookup extends Lookup implements Serializable /** * */ - private static final long serialVersionUID = 2228200000988048623L; + private static final long serialVersionUID = 2288661955135689187L; /** * MLookup Constructor @@ -488,6 +488,11 @@ public final class MLookup extends Lookup implements Serializable private Object m_directNullKey = null; private Future m_loaderFuture; + public NamePair getDirect (Object key, boolean saveInCache, boolean cacheLocal) + { + return getDirect(key, saveInCache, cacheLocal, null); + } // getDirect + /** * Get Data Direct from Table. * @param key key @@ -495,7 +500,7 @@ public final class MLookup extends Lookup implements Serializable * @param cacheLocal cache locally for r/o * @return value */ - public NamePair getDirect (Object key, boolean saveInCache, boolean cacheLocal) + public NamePair getDirect (Object key, boolean saveInCache, boolean cacheLocal, String trxName) { // Nothing to query if (key == null || m_info.QueryDirect == null || m_info.QueryDirect.length() == 0) @@ -520,7 +525,7 @@ public final class MLookup extends Lookup implements Serializable try { // SELECT Key, Value, Name FROM ... - pstmt = DB.prepareStatement(m_info.QueryDirect, null); + pstmt = DB.prepareStatement(m_info.QueryDirect, trxName); if (isNumber) pstmt.setInt(1, Integer.parseInt(key.toString())); else diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WTableDirEditor.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WTableDirEditor.java index 7f6accd3c3..0b4a5e0b27 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WTableDirEditor.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WTableDirEditor.java @@ -39,6 +39,7 @@ import org.adempiere.webui.util.ZKUpdateUtil; import org.adempiere.webui.window.WFieldRecordInfo; import org.adempiere.webui.window.WLocationDialog; import org.compiere.model.GridField; +import org.compiere.model.GridTable; import org.compiere.model.Lookup; import org.compiere.model.MBPartnerLocation; import org.compiere.model.MLocation; @@ -413,7 +414,16 @@ ContextMenuListener, IZoomableEditor { if (lookup != null) { - NamePair pair = lookup.getDirect(oldValue, false, false); + String trxName = null; + if ( gridField != null + && gridField.getGridTab() != null + && gridField.getGridTab().getTableModel() != null) { + GridTable gt = gridField.getGridTab().getTableModel(); + if (gt.isImporting()) { + trxName = gt.get_TrxName(); + } + } + NamePair pair = lookup.getDirect(oldValue, false, false, trxName); if (pair != null) { if (pair instanceof KeyNamePair) { int key = ((KeyNamePair)pair).getKey();